oyyd / encryptsocks

Encrypt your socks transmission.
BSD 3-Clause "New" or "Revised" License
141 stars 20 forks source link

seems not working in ubuntu 14.04 #34

Closed jeremy-linchao closed 7 years ago

jeremy-linchao commented 7 years ago

In ubuntu14.04, the server side code has the follow problem, In Centos 6.5, it is working. I suspect due to the createServer function performs different in these two platforms

TypeError: Cannot read property 'level' of undefined at Object.startServer (/home/ubuntu/shadowsocks-js/lib/ssServer.js:235:54) at Object. (/home/ubuntu/shadowsocks-js/bin/ssserver:7:28) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:53:21) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10)

oyyd commented 7 years ago

Thanks for your report. I use ss server in ubuntu 14.02 myself and it works well. Can you show me the version of your ssjs(by serverssjs -h)? I would like to check this tomorrow.

jeremy-linchao commented 7 years ago

serverssjs -h

shadowsocks-js 1.1.3

oyyd commented 7 years ago

Hi, @jeremy-linchao. I couldn't reproduce this issuse in my ubuntu 14.04. I notice that your error thrown at line 235 but the code that seems to use config.level is at line 233. Did you ever modify the code?

jeremy-linchao commented 7 years ago

yeah, I just add the config of server_address for the createServer function because the global serverssjs are not able to listen on the tcp port of IPv4 but only IPv6 such as following

ubuntu@10-8-41-210:~$ netstat -tan Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN tcp 0 92 10.8.41.210:22 116.231.2.103:60743 ESTABLISHED tcp6 0 0 :::22 ::: LISTEN tcp6 0 0 :::8388 :::* LISTEN

oyyd commented 7 years ago

I guess that your modification makes the daemon fail to pass config object to workers.

And yes, you are right. Currently serverssjs doesn't actually use the serverAddr config. It always uses the unspecified ip address and thus it will listen to the ipv6 address. In most operating systems, listening to the unspecified ipv6 address may cause node to also listen on unspecified ipv4 address but it's still an unexpected feature. I will fix this this weekend and thanks for your report!

jeremy-linchao commented 7 years ago

OK

oyyd commented 7 years ago

@jeremy-linchao please check the 1.2.1 release

jeremy-linchao commented 7 years ago

I have tried the 1.2.1 and it is ok but I think there is still some little problem about udp cmd: serverssjs -c config error: "2017-03-29T06:40:12.936Z - error: udp_relay socket err: bind EADDRINUSE :::8388"

oyyd commented 7 years ago

Yes. ipv6 binding is not always available. I will hide this message in the next version.