-
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
SIP002 and SIP003 support. #1298
Conversation
0f32572
to
fe2411e
Compare
Fixed it enough, seems to work now. Tested with simple-obfs but is it normal to have plugin process for each connection ? Waiting for feedback, thanks in advance. [EDIT: Removed simple-obfs windows build, I made an msys2 build by mistake that depends on msys2 installed on machine, will compile properly using mingw32] |
I will implement a better approach for this in the coming days (single process for plugin, and cleaner implementation). |
Thank you @rwasef1830 |
2538f46
to
2731d06
Compare
New cleaner approach done. Did a force push. Now it is a single plugin process per server and it is automatically restarted if it crashes or is killed. Process launch is protected by lock. Waiting for review and merge ;-) |
Turns out that it is not possible to compile simple-obfs using mingw-w64 (because of posix semantics, error in sys/select.h), so I redid build on latest master and bundled the needed msys dlls in the archive. 64-bit simple-obfs shadowsocks/simple-obfs@1126971 msys2 build. Should run on any 64-bit Windows 7 and higher. Still waiting for feedback and/or merge ;-) |
Rebased and force pushed on latest master. I hope this get merged soon, can't wait to use this functionality :-) Any devs around to review ? :-) |
I saw you added
|
Yes, this is described in the SIP003 standard shadowsocks/shadowsocks-org#28 and https://shadowsocks.org/en/spec/Plugin.html Any SIP003 plugin to work with shadowsocks must read from these environment vars, so when I start the plugin, I pass them in ProcessStartInfo. |
Made a force push to fix a tiny embarrassing one line null check in StopPlugins() (forgot to check if the server plugin was null :-D). |
{ | ||
throw new ArgumentException("Value cannot be null or whitespace.", nameof(serverAddress)); | ||
} | ||
if ((uint)serverPort != serverPort) |
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.
Is it necessary to check the negative port number?
Port number should between 1 to 65535.
Server port in config file should have been verified when user added the new entry.
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.
Ah a silly mistake, I was intending to cast to ushort to verify range ... etc.
I don't like depending on checking only in higher levels of code in general, I consider each method should check its inputs (especially if there is negligible performance cost).
@celeron533 pushed a fix to the range check and moving the Sip003Plugin class. |
I thinks this pull request is ready to merge? @celeron533 |
@madeye @celeron533 For completeness sake, there are a few strings added to the GUI and I didn't add translations for them (in the Server config form) |
Added a notification message on Forward Proxy form. preview: celeron533@05df449 |
do i have to compile |
Hello,
This is a first draft WIP to get feedback on my approach. This pull request implements SIP002 url (parsing and generation for QR code with backward-compatibility of accepting old-style urls and generating old-style urls when there is no plugin for the config), and SIP003 plugin interface for shadowsocks-windows.
Hope to eventually get this merged soon :-)