-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bind: address already in use #6
Comments
cd cmd/socks5/ &&
go build &&
cd ../.. &&
./cmd/socks5/socks5 &
socks5_pid=$!; The cd cmd/socks5/ &&
go build &&
cd ../..
#########################
./cmd/socks5/socks5 &
socks5_pid=$! Separate builds and runs to get their pid correctly |
facepalm. thanks! run.sh#!/usr/bin/env bash
set -e
proxy_port=1080
netstat_out="$(netstat -nap 2>/dev/null | grep -w $proxy_port || true)"
if [ -n "$netstat_out" ]; then
echo "error: address already in use"
echo "found $(echo "$netstat_out" | wc -l) open connections with port $proxy_port:"
echo "$netstat_out"
#if true; then
if false; then
exit 1
else
echo "killing worker procs using port $proxy_port"
netstat -nap 2>/dev/null | grep -w $proxy_port | awk '{ print $7 }' | cut -d/ -f1 | grep -vxFe - | xargs -r kill
fi
fi
cd cmd/socks5/
go build
cd ../..
./cmd/socks5/socks5 &
socks5_pid=$!;
echo socks5_pid: $socks5_pid;
sleep 2;
#if true; then
if false; then
# socks5
curl --no-keepalive --proxy socks5://localhost:$proxy_port https://httpbin.org/ip;
else
# socks5h
curl --no-keepalive --proxy socks5h://localhost:$proxy_port https://httpbin.org/ip;
fi
kill $socks5_pid now after running some cycles, there are some open connections
but they are not blocking the start of a new proxy server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
im getting this error after killing and restarting the socks5 server
maybe the server is missing some cleanup code, to close all connections
im killing the server with control-c (sigint)
so the server should have enough time for cleanup
run.sh
problem: the worker process 371359 keeps running
after then main process 371297 was killed
The text was updated successfully, but these errors were encountered: