[GH-ISSUE #41] Problem while setting up #34

Open
opened 2026-02-26 12:33:47 +03:00 by kerem · 9 comments
Owner

Originally created by @obvioususername on GitHub (Aug 3, 2019).
Original GitHub issue: https://github.com/cbeuw/Cloak/issues/41

Hello, i set up the SS server with Cloak, but got an error when running ss-server

the error info line : ck-server.go:254: Configuration file error: Failed to unmarshal: invalid character '}' looking for beginning of object key string

My ckserver.json looks like this :
{
"ProxyBook":{
"shadowsocks":"127.0.0.1:1488",
},
"RedirAddr":"54.222.60.218:443",
"PrivateKey":"myprivatekey",
"AdminUID":"myadminuid",
"DatabasePath":"home/peiper/cloak/userinfo.db"
}

I cpoied the json file in your github code and edit it. Anything wrong with it ?

Originally created by @obvioususername on GitHub (Aug 3, 2019). Original GitHub issue: https://github.com/cbeuw/Cloak/issues/41 Hello, i set up the SS server with Cloak, but got an error when running `ss-server` the error info line : `ck-server.go:254: Configuration file error: Failed to unmarshal: invalid character '}' looking for beginning of object key string` My `ckserver.json` looks like this : { "ProxyBook":{ "shadowsocks":"127.0.0.1:1488", }, "RedirAddr":"54.222.60.218:443", "PrivateKey":"myprivatekey", "AdminUID":"myadminuid", "DatabasePath":"home/peiper/cloak/userinfo.db" } I cpoied the json file in your github code and edit it. Anything wrong with it ?
Author
Owner

@cbeuw commented on GitHub (Aug 3, 2019):

I think it's due to the trailing comma after shadowsocks' entry in ProxyBook, try removing it

<!-- gh-comment-id:517926500 --> @cbeuw commented on GitHub (Aug 3, 2019): I think it's due to the trailing comma after shadowsocks' entry in ProxyBook, try removing it
Author
Owner

@obvioususername commented on GitHub (Aug 3, 2019):

I think it's due to the trailing comma after shadowsocks' entry in ProxyBook, try removing it

It worked. Thank you. The SS-server started successfully and the client is running as well, however the proxy is not actually working.
Here is the log of shadowsocks' client :

[2019-08-03 23:38:10] Started SIP003 plugin for ...:8388 on 127.0.0.1:54797 - PID: 2624
[2019-08-03 23:38:10] ...:8388 timed out
[2019-08-03 23:38:10] Started SIP003 plugin for ...:8388 on 127.0.0.1:54801 - PID: 6300
[2019-08-03 23:38:11] ...:8388 timed out
[2019-08-03 23:38:11] Started SIP003 plugin for ...:8388 on 127.0.0.1:54806 - PID: 4828
[2019-08-03 23:38:11] ...:8388 timed out
[2019-08-03 23:38:11] Started SIP003 plugin for ...:8388 on 127.0.0.1:54811 - PID: 3460
[2019-08-03 23:38:11] Started SIP003 plugin for ...:8388 on 127.0.0.1:54816 - PID: 1848
[2019-08-03 23:38:11] Started SIP003 plugin for ...:8388 on 127.0.0.1:54824 - PID: 3736
[2019-08-03 23:38:12] ...:8388 timed out
[2019-08-03 23:38:12] Started SIP003 plugin for ...:8388 on 127.0.0.1:54830 - PID: 5492
[2019-08-03 23:38:12] ...:8388 timed out
[2019-08-03 23:38:12] ...:8388 timed out
[2019-08-03 23:38:12] Started SIP003 plugin for ...:8388 on 127.0.0.1:54839 - PID: 1676
[2019-08-03 23:38:12] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接


在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult)
在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult)
在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar)
[2019-08-03 23:38:12] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接


在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult)
在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult)
在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar)
[2019-08-03 23:38:13] ...:8388 timed out
[2019-08-03 23:38:13] ...:8388 timed out
[2019-08-03 23:38:13] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接


在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult)
在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult)
在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar)
[2019-08-03 23:38:13] Started SIP003 plugin for ...:8388 on 127.0.0.1:54844 - PID: 4460
[2019-08-03 23:38:13] Started SIP003 plugin for ...:8388 on 127.0.0.1:54849 - PID: 6640
[2019-08-03 23:38:13] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接


在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult)
在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult)
在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar)
[2019-08-03 23:38:14] ...:8388 timed out
[2019-08-03 23:38:14] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接


在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult)
在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult)
在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar)
[2019-08-03 23:38:14] Started SIP003 plugin for ...:8388 on 127.0.0.1:54854 - PID: 3596
[2019-08-03 23:38:15] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接


在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult)
在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult)
在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar)
[2019-08-03 23:38:16] Started SIP003 plugin for ...:8388 on 127.0.0.1:54861 - PID: 6680
[2019-08-03 23:38:17] ...:8388 timed out
[2019-08-03 23:38:17] Started SIP003 plugin for ...:8388 on 127.0.0.1:54866 - PID: 4280
[2019-08-03 23:38:18] ...:8388 timed out

Here is the Shadowsocks server's config.json :
{
"server":"myserver'sIP",
"server_port":8388,
"local_port":1080,
"password":"mypassword",
"timeout":1,
"method":"chacha20-ietf-poly1305",
"plugin":"/home/peiper/cloak/ck-server-linux-amd64-1.1.2",
"plugin_opts":"/home/peiper/cloak/ckserver.json"
}

And here's my ckserver.json :
{
"ProxyBook":{
"shadowsocks":"myserver'sIP:8388"
},
"RedirAddr":"54.222.60.218:443",
"PrivateKey":"myprivatekey",
"AdminUID":"myUID",
"DatabasePath":"/home/peiper/cloak/userinfo.db"
}

Besides, i tried run sudo ck-server -c <path to ckserver.json>, but i got an error says ck-server.go:244: Must specify localAddr

<!-- gh-comment-id:517934885 --> @obvioususername commented on GitHub (Aug 3, 2019): > > > I think it's due to the trailing comma after shadowsocks' entry in ProxyBook, try removing it It worked. Thank you. The SS-server started successfully and the client is running as well, however the proxy is not actually working. Here is the log of shadowsocks' client : [2019-08-03 23:38:10] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54797 - PID: 2624 [2019-08-03 23:38:10] *.*.*.*:8388 timed out [2019-08-03 23:38:10] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54801 - PID: 6300 [2019-08-03 23:38:11] *.*.*.*:8388 timed out [2019-08-03 23:38:11] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54806 - PID: 4828 [2019-08-03 23:38:11] *.*.*.*:8388 timed out [2019-08-03 23:38:11] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54811 - PID: 3460 [2019-08-03 23:38:11] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54816 - PID: 1848 [2019-08-03 23:38:11] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54824 - PID: 3736 [2019-08-03 23:38:12] *.*.*.*:8388 timed out [2019-08-03 23:38:12] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54830 - PID: 5492 [2019-08-03 23:38:12] *.*.*.*:8388 timed out [2019-08-03 23:38:12] *.*.*.*:8388 timed out [2019-08-03 23:38:12] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54839 - PID: 1676 [2019-08-03 23:38:12] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接 。 在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult) 在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult) 在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar) [2019-08-03 23:38:12] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接 。 在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult) 在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult) 在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar) [2019-08-03 23:38:13] *.*.*.*:8388 timed out [2019-08-03 23:38:13] *.*.*.*:8388 timed out [2019-08-03 23:38:13] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接 。 在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult) 在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult) 在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar) [2019-08-03 23:38:13] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54844 - PID: 4460 [2019-08-03 23:38:13] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54849 - PID: 6640 [2019-08-03 23:38:13] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接 。 在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult) 在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult) 在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar) [2019-08-03 23:38:14] *.*.*.*:8388 timed out [2019-08-03 23:38:14] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接 。 在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult) 在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult) 在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar) [2019-08-03 23:38:14] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54854 - PID: 3596 [2019-08-03 23:38:15] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接 。 在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult) 在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult) 在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar) [2019-08-03 23:38:16] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54861 - PID: 6680 [2019-08-03 23:38:17] *.*.*.*:8388 timed out [2019-08-03 23:38:17] Started SIP003 plugin for *.*.*.*:8388 on 127.0.0.1:54866 - PID: 4280 [2019-08-03 23:38:18] *.*.*.*:8388 timed out Here is the Shadowsocks server's config.json : { "server":"myserver'sIP", "server_port":8388, "local_port":1080, "password":"mypassword", "timeout":1, "method":"chacha20-ietf-poly1305", "plugin":"/home/peiper/cloak/ck-server-linux-amd64-1.1.2", "plugin_opts":"/home/peiper/cloak/ckserver.json" } And here's my ckserver.json : { "ProxyBook":{ "shadowsocks":"myserver'sIP:8388" }, "RedirAddr":"54.222.60.218:443", "PrivateKey":"myprivatekey", "AdminUID":"myUID", "DatabasePath":"/home/peiper/cloak/userinfo.db" } Besides, i tried run `sudo ck-server -c <path to ckserver.json>`, but i got an error says ` ck-server.go:244: Must specify localAddr`
Author
Owner

@Klaaktu commented on GitHub (Aug 9, 2019):

@cbeuw Does ProxyBook setting matter if ck-server is started as a shadowsocks plugin? Or should I also configure ss to listen on local only, and put local address in ProxyBook?
@obvioususername As far as I can tell, the error suggests something like localhost:1080 in ckserver.json instead of public ip. Also the timeout in shadowsocks' config might be too short https://github.com/shadowsocks/shadowsocks-libev/issues/2#issuecomment-17932222 .

<!-- gh-comment-id:520095997 --> @Klaaktu commented on GitHub (Aug 9, 2019): @cbeuw Does ProxyBook setting matter if ck-server is started as a shadowsocks plugin? Or should I also configure ss to listen on local only, and put local address in ProxyBook? @obvioususername As far as I can tell, the error suggests something like localhost:1080 in ckserver.json instead of public ip. Also the timeout in shadowsocks' config might be too short https://github.com/shadowsocks/shadowsocks-libev/issues/2#issuecomment-17932222 .
Author
Owner

@cbeuw commented on GitHub (Aug 9, 2019):

@klaaktu The ProxyBook entry for "shadowsocks" is ignored if ck-server is started as a plugin, so you don't need to put shadowsocks' listening address in ProxyBook

<!-- gh-comment-id:520096666 --> @cbeuw commented on GitHub (Aug 9, 2019): @klaaktu The ProxyBook entry for "shadowsocks" is ignored if ck-server is started as a plugin, so you don't need to put shadowsocks' listening address in ProxyBook
Author
Owner

@Klaaktu commented on GitHub (Aug 11, 2019):

@cbeuw In shadowsocks plugin mode section, the wiki says "plugin_opts": "-c <path to ckserver.json>". I think it's just "plugin_opts": "<path to ckserver.json>" without the -c right?
Also ck-client is getting false positive in windows.

<!-- gh-comment-id:520250648 --> @Klaaktu commented on GitHub (Aug 11, 2019): @cbeuw In shadowsocks plugin mode section, the wiki says `"plugin_opts": "-c <path to ckserver.json>"`. I think it's just `"plugin_opts": "<path to ckserver.json>"` without the `-c ` right? Also ck-client is getting false positive in windows.
Author
Owner

@cbeuw commented on GitHub (Aug 12, 2019):

@klaaktu Yup that's right. Good catch!

Do you mean anti-virus false positive?

<!-- gh-comment-id:520437853 --> @cbeuw commented on GitHub (Aug 12, 2019): @klaaktu Yup that's right. Good catch! Do you mean anti-virus false positive?
Author
Owner

@Klaaktu commented on GitHub (Aug 12, 2019):

@cbeuw yea, anti-virus, the pc with latest update of windows defender's intelligence. In windows defender and chrome's download (which is also scanned by windows iirc).

<!-- gh-comment-id:520470206 --> @Klaaktu commented on GitHub (Aug 12, 2019): @cbeuw yea, anti-virus, the pc with latest update of windows defender's intelligence. In windows defender and chrome's download (which is also scanned by windows iirc).
Author
Owner

@cbeuw commented on GitHub (Aug 12, 2019):

@klaaktu Windows Smartscreen did pick it up because "very few people have downloaded it". It did the same for all the previous versions as well though so I think it probably flags every .exe that's not frequently seen by it. I scanned it with Windows Defender and it didn't pick up anything. https://www.virustotal.com/gui/file/f65f2d58bc02641db99fc192c2a7c4e5d25a27fb0bc1bc83cc07568379bce2f1/detection appears mostly fine.

<!-- gh-comment-id:520507578 --> @cbeuw commented on GitHub (Aug 12, 2019): @klaaktu Windows Smartscreen did pick it up because "very few people have downloaded it". It did the same for all the previous versions as well though so I think it probably flags every .exe that's not frequently seen by it. I scanned it with Windows Defender and it didn't pick up anything. https://www.virustotal.com/gui/file/f65f2d58bc02641db99fc192c2a7c4e5d25a27fb0bc1bc83cc07568379bce2f1/detection appears mostly fine.
Author
Owner

@gabrix73 commented on GitHub (Oct 27, 2023):

Cloak is on debian bullseye vps.

:~# ck-server -c /etc/cloak/ckserver.json 
2023/10/27 21:09:32 ck-server.go:244: Must specify localAddr

And ....

:~# systemctl status cloak-server.service 
● cloak-server.service - Cloak Server Service
     Loaded: loaded (/etc/systemd/system/cloak-server.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2023-10-25 20:45:33 CEST; 2 days ago
   Main PID: 31977 (code=exited, status=1/FAILURE)
        CPU: 6ms

Oct 25 20:45:33 ciolo systemd[1]: Started Cloak Server Service.
Oct 25 20:45:33 ciolo ck-server[31977]: time="2023-10-25T20:45:33+02:00" level=info msg="Starting standalone mode"
Oct 25 20:45:33 ciolo ck-server[31977]: time="2023-10-25T20:45:33+02:00" level=info msg="Listening on :443"
Oct 25 20:45:33 ciolo ck-server[31977]: time="2023-10-25T20:45:33+02:00" level=fatal msg="listen tcp :443: bind: address already in use"
Oct 25 20:45:33 ciolo systemd[1]: cloak-server.service: Main process exited, code=exited, status=1/FAILURE
Oct 25 20:45:33 ciolo systemd[1]: cloak-server.service: Failed with result 'exit-code

Port 443:

:~# netstat -anptl | grep 443
tcp        0      0 185.56.219.30:45372     185.241.208.245:443     ESTABLISHED 21495/tor           
tcp        0      0 185.56.219.30:22792     172.104.93.80:443       ESTABLISHED 27471/dnscrypt-prox

And this is ckserver.json


:~# cat /etc/cloak/ckserver.json
{
  "ProxyBook": {
    "panel":["tcp","127.0.0.1:1984"] , "shadowsocks":["tcp","127.0.0.1:51027"] 
  },
  "BypassUID": [
    "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ],
  "localAddr": "1.2.3.4"
  "BindAddr":["0.0.0.0:443"],
  "RedirAddr": "204.79.197.200:443",
  "PrivateKey": "xxxxxxxxxxxxxxxxxx",
  "PublicKey": "xxxxxxxxxxxxxxxxxxxx"
  "AdminUID": "xxxxxxxxxxxxxxxxxxxxxx",
  "DatabasePath": "userinfo.db",
  "StreamTimeout": 300
}
<!-- gh-comment-id:1783393527 --> @gabrix73 commented on GitHub (Oct 27, 2023): Cloak is on debian bullseye vps. ``` :~# ck-server -c /etc/cloak/ckserver.json 2023/10/27 21:09:32 ck-server.go:244: Must specify localAddr ``` And .... ``` :~# systemctl status cloak-server.service ● cloak-server.service - Cloak Server Service Loaded: loaded (/etc/systemd/system/cloak-server.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2023-10-25 20:45:33 CEST; 2 days ago Main PID: 31977 (code=exited, status=1/FAILURE) CPU: 6ms Oct 25 20:45:33 ciolo systemd[1]: Started Cloak Server Service. Oct 25 20:45:33 ciolo ck-server[31977]: time="2023-10-25T20:45:33+02:00" level=info msg="Starting standalone mode" Oct 25 20:45:33 ciolo ck-server[31977]: time="2023-10-25T20:45:33+02:00" level=info msg="Listening on :443" Oct 25 20:45:33 ciolo ck-server[31977]: time="2023-10-25T20:45:33+02:00" level=fatal msg="listen tcp :443: bind: address already in use" Oct 25 20:45:33 ciolo systemd[1]: cloak-server.service: Main process exited, code=exited, status=1/FAILURE Oct 25 20:45:33 ciolo systemd[1]: cloak-server.service: Failed with result 'exit-code ``` Port 443: ``` :~# netstat -anptl | grep 443 tcp 0 0 185.56.219.30:45372 185.241.208.245:443 ESTABLISHED 21495/tor tcp 0 0 185.56.219.30:22792 172.104.93.80:443 ESTABLISHED 27471/dnscrypt-prox ``` And this is ckserver.json ``` :~# cat /etc/cloak/ckserver.json { "ProxyBook": { "panel":["tcp","127.0.0.1:1984"] , "shadowsocks":["tcp","127.0.0.1:51027"] }, "BypassUID": [ "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ], "localAddr": "1.2.3.4" "BindAddr":["0.0.0.0:443"], "RedirAddr": "204.79.197.200:443", "PrivateKey": "xxxxxxxxxxxxxxxxxx", "PublicKey": "xxxxxxxxxxxxxxxxxxxx" "AdminUID": "xxxxxxxxxxxxxxxxxxxxxx", "DatabasePath": "userinfo.db", "StreamTimeout": 300 } ```
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Cloak#34
No description provided.