wzshiming / socks5 Goto Github PK
View Code? Open in Web Editor NEWSocks5/Socks5h server and client. Full TCP/Bind/UDP and IPv4/IPv6 support
License: MIT License
Socks5/Socks5h server and client. Full TCP/Bind/UDP and IPv4/IPv6 support
License: MIT License
im getting this error after killing and restarting the socks5 server
$ ./cmd/socks5/socks5
[socks5] 2023/11/29 17:40:38 listen tcp :1080: bind: address already in use
maybe the server is missing some cleanup code, to close all connections
after killing and restarting the socks5 server
im killing the server with control-c (sigint)
so the server should have enough time for cleanup
run.sh
#!/usr/bin/env bash
set -e
netstat_out="$(netstat -nap 2>/dev/null | grep -w 1080 || true)"
if [ -n "$netstat_out" ]; then
echo "error: address already in use"
echo "$netstat_out"
if true; then
exit 1
else
echo "killing worker procs using port 1080"
netstat -nap 2>/dev/null | grep -w 1080 | awk '{ print $7 }' | cut -d/ -f1 | xargs kill
fi
fi
cd cmd/socks5/ &&
go build &&
cd ../.. &&
./cmd/socks5/socks5 &
socks5_pid=$!;
echo socks5_pid: $socks5_pid;
sleep 1;
curl --proxy socks5h://localhost:1080 https://httpbin.org/ip;
kill $socks5_pid
$ ./run.sh
socks5_pid: 371297
{
"origin": "xxxxxxxxxxxxx"
}
$ ./run.sh
error: address already in use
tcp6 0 0 :::1080 :::* LISTEN 371359/./cmd/socks5
tcp6 0 0 ::1:60936 ::1:1080 TIME_WAIT -
problem: the worker process 371359 keeps running
after then main process 371297 was killed
hi,
nice package! thx alot!
there is a problem in: handleAssociate
seems like it returns ipv6 address and port 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.