python-proxy icon indicating copy to clipboard operation
python-proxy copied to clipboard

add a server "SOCKS5" setup guide

Open heX16 opened this issue 5 years ago • 2 comments

Cause: For a person who is not a system administrator and who first bought a server with Linux. It is not at all obvious how to configure your first server. There are many different exotic examples in the manual (readme.md), but there is no description of the most common usage scenario (which is needed at 99%).


Instruction to configure Socks5 server, where port 445, login "socks5_login", password "socks5_password" (note: never leave your socks5 service without a password - it will be found and used in less than a week).

pip3 install pproxy useradd --no-create-home -s /usr/sbin/nologin pproxy

Create file: /etc/systemd/system/pproxy.service

[Unit]
    Description=python proxy socks5
    After=network-online.target
    Wants=network-online.target

[Service]
    Type=simple
    ExecStart=/usr/local/bin/pproxy -l socks5://:445/#socks5_login:socks5_password
    User=pproxy
    Group=pproxy
    Restart=on-failure

[Install]
    WantedBy=multi-user.target

systemctl enable pproxy systemctl start pproxy systemctl status pproxy

heX16 avatar Nov 19 '20 08:11 heX16

Very useful,thanks

ackurdeeve avatar Apr 11 '21 06:04 ackurdeeve

xinmans@ubuntu-dev:~/mydev/spider/pproxy_socks5$ systemctl status pproxy1 ● pproxy1.service - python proxy socks5 Loaded: loaded (/etc/systemd/system/pproxy1.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sun 2022-10-09 18:06:19 CST; 1s ago Process: 581292 ExecStart=/home/xinmans/.local/bin/pproxy -l http://192.168.31.158:7771 -r socks5://192.168.31.11:8081 -vv (code=exited, status=1/FAILURE) Main PID: 581292 (code=exited, status=1/FAILURE)

Oct 09 18:06:19 ubuntu-dev systemd[1]: pproxy1.service: Scheduled restart job, restart counter is at 5. Oct 09 18:06:19 ubuntu-dev systemd[1]: Stopped python proxy socks5. Oct 09 18:06:19 ubuntu-dev systemd[1]: pproxy1.service: Start request repeated too quickly. Oct 09 18:06:19 ubuntu-dev systemd[1]: pproxy1.service: Failed with result 'exit-code'. Oct 09 18:06:19 ubuntu-dev systemd[1]: Failed to start python proxy socks5. xinmans@ubuntu-dev:~/mydev/spider/pproxy_socks5$ /home/xinmans/.local/bin/pproxy -l http://192.168.31.158:7771 -r socks5://192.168.31.11:8081 -vv Serving on 192.168.31.158:7771 by http DIRECT: 0 (0.0K/s,0.0K/s) PROXY: 0 (0.0K/s,0.0K/s)

xinmans@ubuntu-dev:~/mydev/spider/pproxy_socks5$ sudo cat /etc/systemd/system/pproxy1.service [Unit] Description=python proxy socks5 After=network-online.target Wants=network-online.target

[Service] Type=simple ExecStart=/home/xinmans/.local/bin/pproxy -l http://192.168.31.158:7771 -r socks5://192.168.31.11:8081 -vv User=xinmans Group=xinmans Restart=on-failure

[Install] WantedBy=multi-user.target

what's wrong?

xinmans avatar Oct 09 '22 10:10 xinmans