-
Notifications
You must be signed in to change notification settings - Fork 16.4k
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
1. Pass options to SIP003 plug-in through the Agruments property; 2. … #1684
Conversation
…The Port of SIP003's "LocalEndPoint" should be Remote Server's port when a plug-in enabled.
@@ -55,6 +55,7 @@ private Sip003Plugin(string plugin, string pluginOpts, string serverAddress, int | |||
StartInfo = new ProcessStartInfo | |||
{ | |||
FileName = plugin, | |||
Arguments = pluginOpts, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To whom also reviewing this PR:
as mentioned in shadowsocks/shadowsocks-org#28
- Passing arguments to a plugin
A plugin accepts arguments through environment variables.
Standard SIP003 implementation not only take care on Windows, Linux or Mac, but also need to provide maximum compatibility to embedded system such as routers, or cellphones. That's why it chooses environment variables.
@@ -86,7 +87,7 @@ public bool StartIfNeeded() | |||
return false; | |||
} | |||
|
|||
var localPort = GetNextFreeTcpPort(); | |||
var localPort = int.Parse(_pluginProcess.StartInfo.Environment["SS_REMOTE_PORT"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SS_LOCAL_HOST
SS_LOCAL_PORT
: the plugin listens SS native connection.
SS_REMOTE_HOST
SS_REMOTE_PORT
: the plugin then connect to the remote server.
SS ===> to plugin's LOCAL HOST/PORT ===> plug-in data processing ===> send to REMOTE HOST/PORT
@celeron533 , I agree with you that Plugin should following the standard. The only issue is that I can not specify the listen port of kcptun, because it's generated by Shadowsocks. |
@ylhyh , BTW, in your code change it is SIP003 is a standard. You 'should' always uses the plugin programs which follow the standard. |
|
anyway, cancel the request now. |
…The Port of SIP003's "LocalEndPoint" should be Remote Server's port when a plug-in enabled.