shadowsocks / shadowsocks-manager

A shadowsocks manager tool for multi user and traffic control.
https://shadowsocks.github.io/shadowsocks-manager/
GNU General Public License v3.0
4.12k stars 1.53k forks source link

我用php python 写了几个脚本 为啥都连不上 ss-manager的socks? #643

Closed littlesum closed 4 years ago

littlesum commented 4 years ago

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:

# 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

finally: print >>sys.stderr, 'closing socket' sock.close()

littlesum commented 4 years ago

为啥socks 文件没有自动删除 是进程没开