# Send data
message = 'This is the message. It will be repeated.'
print >>sys.stderr, 'sending "%s"' % message
sock.sendall(message)
amount_received = 0
amount_expected = len(message)
while amount_received < amount_expected:
data = sock.recv(16)
amount_received += len(data)
print >>sys.stderr, 'received "%s"' % data
Please answer these questions before submitting your issue. Thanks!
(Please mention that if the issue you filed is solved, you may wish to close it by yourself. Thanks again.)
(PS, you can remove 3 lines above, including this one, before post your issue.)
What version of shadowsocks-manager are you using?
3.34
What operating system are you using?
Ubuntu 20.04
What version of Node.js are you using?
What did you do?
Python 连接socks
What did you expect to see?
What did you see instead?
What is your config in detail (with all sensitive info masked)?
{ "server":"0.0.0.0", "port_password":{ "1443":"zz01zz" }, "local_port":578899, "timeout":60, "method":"chacha20-ietf-poly1305", "mode":"tcp_and_udp", "fast_open":true, "plugin":"obfs-server", "plugin_opts":"obfs=tls;obfs-host=youku.com;fast-open" }
usr/bin/python
-- coding: UTF-8 --
文件名:test.py
import socket import sys
Create a UDS socket
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
Connect the socket to the port where the server is listening
server_address = '/home/lee/.ss-manager.socks' print >>sys.stderr, 'connecting to %s' % server_address try: sock.connect(server_address) except socket.error, msg: print >>sys.stderr, msg sys.exit(1) try:
finally: print >>sys.stderr, 'closing socket' sock.close()