Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于shadowsocks-windows中插件参数的问题 #1896

Closed
LYCX2015 opened this issue Jun 18, 2018 · 13 comments
Closed

关于shadowsocks-windows中插件参数的问题 #1896

LYCX2015 opened this issue Jun 18, 2018 · 13 comments

Comments

@LYCX2015
Copy link

LYCX2015 commented Jun 18, 2018

Shadowsocks version / 影梭版本
4.0.10

Environment(Operating system, .NET Framework, etc) / 使用环境(操作系统,.NET Framework等)
win10*64

开发者们,您们好,我想请问下,主程序中的插件参数怎么填?
我在网上可以查到插件程序及插件选项的填法,比如这样:
插件程序:obfs-local
插件选项:obfs=tls;obfs-host=www.bing.com
但是插件参数却没有相应的使用说明,可能是功能是最近才开发出来的,所以网上没有相应的使用说明,故来此请教,烦请告之,谢谢。
qq 20180618171155

@chenshaoju
Copy link
Collaborator

#1847

@LYCX2015
Copy link
Author

好的,谢谢告之,目前符合SIP003规范的插件,仅有 kcptun 及 simple-obf ?

@celeron533
Copy link
Contributor

@LYCX2015 而且是改版过的kcptun和simple-obfs
原版的没有SIP003支持

@john564
Copy link

john564 commented Jun 18, 2018

#1813

For obfs
Get obfs-local.exe from
https://github.com/shadowsocks/simple-obfs/releases

examples (both examples tested and working)

following SIP003 standard to pass parameters

Plugin Program C:\obfs-local.exe
Plugin Options obfs=http;obfs-host=www.bing.com

or

CLI non SIP003 standard

Plugin Program C:\obfs-local.exe
Plugin Arguments --obfs http --obfs-host www.bing.com

Again, remember, need to make a new instance of shadowsocks to connect to the listening port of obfs-server, on the server. (not the ss listening port on the server you normally connect to)

For more help with CLI non SIP003 passing of parameters, see standard help

obfs-local.exe --help

simple-obfs 0.0.5


  usage:

    obfs-local

       --obfs <http|tls>          Enable obfuscating: HTTP or TLS (Experimental).
       --obfs-host <host_name>    Hostname for obfuscating (Experimental).

       [-a <user>]                Run as another user.
       [-f <pid_file>]            The file path to store pid.
       [-t <timeout>]             Socket timeout in seconds.
       [-c <config_file>]         The path to config file.
       [-b <local_address>]       Local address to bind.
       [--fast-open]              Enable TCP fast open with Linux kernel > 3.7.0.
       [-v]                       Verbose mode.
       [-h, --help]               Print this message.

@celeron533
Copy link
Contributor

CLI non SIP003 standard

Plugin Program C:\obfs-local.exe
Plugin Arguments --obfs http --obfs-host www.bing.com

@john564 , you should also add SS_REMOTE_HOST, SS_REMOTE_PORT, SS_LOCAL_HOST, SS_LOCAL_PORT, SS_PLUGIN_OPTIONS when the plugin program does not support SIP003 standard.

Reference: #1672

@john564
Copy link

john564 commented Jun 28, 2018

@celeron533

1) In the shadowsocks GUI (ver 4.0.10), you cannot leave the following fields empty.

Empty "Proxy port" gives error
input string was not in a correct format.

Empty "Server Addr" gives error
Invalid server address

Empty "Server Port" gives error
Illegal port number format

So this data must be entered in the shadowsocks GUI.
"Server Addr" and "Server Port" are the obfs server and port
not shadowsocks server and port

2) trying to put the same data again as arguments does not work

-s %SS_REMOTE_HOST% -p %SS_REMOTE_PORT% -l %SS_LOCAL_PORT% -b %SS_LOCAL_HOST% --obfs http --obfs-host www.bing.com
e.g.
-s 1.2.3.4 -p 1010 -l 1020 -b 127.0.0.1 --obfs http --obfs-host www.bing.com

where
SS_REMOTE_HOST = "Server Addr"
SS_REMOTE_PORT = "Server Port"
SS_LOCAL_HOST = 127.0.0.1
SS_LOCAL_PORT = "Proxy port" (should be something else, but don't know what)

removing data -l SS_LOCAL_PORT -b SS_LOCAL_HOST
then it works.
But -s SS_REMOTE_HOST -p SS_REMOTE_PORT
must use the same values as the GUI "Server Addr" and "Server Port"
so there is no point.

@celeron533
Copy link
Contributor

celeron533 commented Jul 1, 2018

@john564
Please try #1818 (comment) to check whether the arguments have been sent to the plugin program or not.

How the plugin program handle the arguments (such as, does not support remote port or port occupied) is not in the scope.

@john564
Copy link

john564 commented Jul 1, 2018

@celeron533

all seems ok.

following #1818 (comment)
Note: misspelling, %SS_LOCSL_PORT% should be %SS_LOCAL_PORT%

The returned values of %SS_REMOTE_HOST% %SS_REMOTE_PORT% %SS_LOCAL_HOST% %SS_LOCAL_PORT% %SS_PLUGIN_OPTIONS% are sent to the plugin program from the GUI of shadowsocks,

%SS_LOCAL_PORT% keeps changing to a random value everytime you restart the connection.

Conclusion,
No need to add
SS_REMOTE_HOST, SS_REMOTE_PORT, SS_LOCAL_HOST, SS_LOCAL_PORT, SS_PLUGIN_OPTIONS
into the arguments field. As these variables data already sent from the GUI of shadowsocks.

SS_REMOTE_HOST = "Server Addr" from GUI
SS_REMOTE_PORT = "Server Port" from GUI
SS_LOCAL_HOST = 127.0.0.1
SS_LOCAL_PORT = Random Port, changes every time you restart connection.
SS_PLUGIN_OPTIONS = "Plugin Options" from GUI

@celeron533
Copy link
Contributor

celeron533 commented Aug 19, 2018

#1974 #1977 has bug fixes

@celeron533
Copy link
Contributor

Please try 4.1.2

@john564
Copy link

john564 commented Sep 18, 2018

Please try 4.1.2

testing 4.1.2, I did not see any functional changes
what am I suppose to see ?

@celeron533
Copy link
Contributor

@john564 4.1.2 has fixed a bug about the Plugin Arguments
And @chenshaoju written a wiki page of how to use Arguments

https://github.com/shadowsocks/shadowsocks-windows/wiki/%E4%BD%BF%E7%94%A8%E9%9D%9ESIP003%E8%A7%84%E8%8C%83%E7%9A%84%E6%8F%92%E4%BB%B6

@john564
Copy link

john564 commented Sep 25, 2018

Thanks, Can confirm its working, Followed this English wiki , and using latest kcptun non-SIP003

https://github.com/shadowsocks/shadowsocks-windows/wiki/Working-with-non-SIP003-standard-Plugin

e.g. works
Plugin Program D:\Shadowsocks\plugin_windows_amd64.exe
Plugin Arguments -l %SS_LOCAL_HOST%:%SS_LOCAL_PORT% -r %SS_REMOTE_HOST%:%SS_REMOTE_PORT% --key herekeyok --crypt salsa20 --mode fast2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants