Git Product home page Git Product logo

socks5's Issues

bind: address already in use

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

handleAssociate

hi,
nice package! thx alot!

there is a problem in: handleAssociate

seems like it returns ipv6 address and port 0

Use Socks5

Please tell me. Can I use your Socks5 solution to replace the default Socks5 FRP plugin or Socks5.apk (which I currently use) on the tunnel client side to provide UDP support in my connection scheme? And can you help me organize my wiring diagram with your tools?

Sheme01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.