falseen / PySocket

PySocket ,一个通过猴子补丁(monkey patch)动态修改 socket 的项目。在不修改源码的情况下给 socket 增加一些诸如限制客户端数量、前置代理之类的功能。让我们将 Monkey Patch 进行到底吧!
https://falseen.github.io/PySocket/
Apache License 2.0
107 stars 43 forks source link

希望支持多用户版的SS #10

Open zjsz007 opened 7 years ago

zjsz007 commented 7 years ago

https://github.com/mengskysama/shadowsocks-rm/tree/manyuser/shadowsocks

测试了下,好像不支持这个版本.数据库连接方便报错

falseen commented 7 years ago

具体报什么错呢?

zjsz007 commented 7 years ago

WARNING:root:db loop Traceback (most recent call last): File "/usr/shadowsocks/dbtransfer.py", line 133, in thread_db DbTransfer.get_instance().push_db_all_user() File "/usr/shadowsocks/dbtransfer.py", line 60, in push_db_all_user dt_transfer = self.get_servers_transfer() File "/usr/shadowsocks/dbtransfer.py", line 49, in get_servers_transfer data, addr = cli.recvfrom(1500) timeout: timed out WARNING:root:db thread except:timed out

falseen commented 7 years ago

这个应该是你数据库的问题吧?删掉socket.py之后正常么?另外你是放的哪个目录?正确的做法是放到有setup.py的目录。

zjsz007 commented 7 years ago

shadowsocks 需要setup.py嘛?之前是只获取了shadowsocks下的shadowsocks文件夹. VPS机器

文件在/usr 下,有兴趣看下?

falseen commented 7 years ago

你这样把密码贴在这里合适么。。

不需要setup.py,只是为了说明应该把socket.py放在什么位置。这里的话需要放到根目录,即 shadowsocks目录。

zjsz007 commented 7 years ago

可以登陆去看下,放到不同目录等级,有不同报错,你指的是需要放在server.py的上级目录吧? By zjsz007 在2017年04月19日 00:17,Falseen 写道: 你这样把密码贴在这里合适么。。 不需要setup.py,只是为了说明应该把socket.py放在什么位置。这里的话需要放到根目录,即 shadowsocks目录。

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/falseen/PySocket","title":"falseen/PySocket","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/falseen/PySocket"}},"updates":{"snippets":[{"icon":"PERSON","message":"@falseen in #10: 你这样把密码贴在这里合适么。。\r\n\r\n不需要setup.py,只是为了说明应该把socket.py放在什么位置。这里的话需要放到根目录,即 shadowsocks目录。"}],"action":{"name":"View Issue","url":"https://github.com/falseen/PySocket/issues/10#issuecomment-294897105"}}}

falseen commented 7 years ago

你需要的是前置代理的功能么 ?

zjsz007 commented 7 years ago
        是限制连接客户端功能

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/falseen/PySocket","title":"falseen/PySocket","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/falseen/PySocket"}},"updates":{"snippets":[{"icon":"PERSON","message":"@falseen in #10: 你需要的是前置代理的功能么 ?\r\n"}],"action":{"name":"View Issue","url":"https://github.com/falseen/PySocket/issues/10#issuecomment-294904084"}}}

falseen commented 7 years ago

额,那你应该用 Limit_Clients 文件夹下的 socket.py 文件。我已经帮你弄好了。我在usr文件夹下新建了一个git文件夹,里面存放的是我的项目。

falseen commented 7 years ago

你自己按照说明修改一下socket.py文件就行了。

zjsz007 commented 7 years ago

呃,感谢,看来是我看Readme 理解能力太差了… By zjsz007 在2017年04月19日 00:46,Falseen 写道: 你自己按照说明修改一下socket.py文件就行了。

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/falseen/PySocket","title":"falseen/PySocket","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/falseen/PySocket"}},"updates":{"snippets":[{"icon":"PERSON","message":"@falseen in #10: 你自己按照说明修改一下socket.py文件就行了。"}],"action":{"name":"View Issue","url":"https://github.com/falseen/PySocket/issues/10#issuecomment-294906323"}}}

zjsz007 commented 7 years ago

Traceback (most recent call last): File "/usr/shadowsocks/shadowsocks/../shadowsocks/tcprelay.py", line 834, in handle_event conn = self._server_socket.accept() File "/usr/shadowsocks/shadowsocks/../socket.py", line 101, in setattr(self, method_name, types.MethodType(lambda *args, *kwds: new_method(method, args, **kwds), self, self)) File "/usr/shadowsocks/shadowsocks/../socket.py", line 123, in new_accept self_socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, struct.pack("II", recv_timeout, 0)) File "", line 1, in setsockopt error: [Errno 22] Invalid argument

移除socket.py后是正常使用的 加密方式:RC4-MD5 端口密码:ss

falseen commented 7 years ago

额,那你先把 set_close_timeout 改为 False 吧,有空我再查查是什么原因引起的。