Updated Manage Multiple Users (markdown)
parent
bf2f05a912
commit
d5cae78987
1 changed files with 6 additions and 5 deletions
|
@ -61,13 +61,14 @@ import socket
|
|||
|
||||
cli = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
|
||||
cli.bind('/tmp/client.sock') # address of the client
|
||||
cli.sendto('ping', '/var/run/shadowsocks-manager.sock') # address of Shadowsocks manager
|
||||
cli.recvfrom(1506) # You'll receive a pong
|
||||
cli.connect('/var/run/shadowsocks-manager.sock') # address of Shadowsocks manager
|
||||
|
||||
cli.sendto(b'add: {"server_port":8001, "password":"7cd308cc059"}', '/var/run/shadowsocks-manager.sock')
|
||||
cli.send(b'ping')
|
||||
print(cli.recv(1506)) # You'll receive a pong
|
||||
|
||||
cli.sendto(b'remove: {"server_port":8001}', '/var/run/shadowsocks-manager.sock')
|
||||
cli.send(b'add: {"server_port":8001, "password":"7cd308cc059"}')
|
||||
cli.send(b'remove: {"server_port":8001}')
|
||||
|
||||
while True:
|
||||
print(cli.recvfrom(1506)) # when data is transferred on Shadowsocks, you'll receive stat info every 10 seconds
|
||||
print(cli.recv(1506)) # when data is transferred on Shadowsocks, you'll receive stat info every 10 seconds
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue