Giter Site home page Giter Site logo

wzshiming / socks5 Goto Github PK

View Code? Open in Web Editor NEW
75.0 7.0 17.0 29 KB

Socks5/Socks5h server and client. Full TCP/Bind/UDP and IPv4/IPv6 support

License: MIT License

Dockerfile 0.57% Go 99.43%
socks5 socks5h socks socks5-server socks5-client bind udp associate connect socks5-proxy

socks5's Introduction

socks5

Socks5/Socks5h server and client

Build Go Report Card GoDoc GitHub license gocover.io

This project is to add protocol support for the Bridge, or it can be used alone

The following is the implementation of other proxy protocols

Usage

API Documentation

Example

  • Support for the CONNECT command
  • Support for the BIND command
  • Support for the ASSOCIATE command

License

Licensed under the MIT License. See LICENSE for the full license text.

socks5's People

Contributors

wzshiming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

socks5's Issues

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

尝试通过 Socks5 代理建立双向 QUIC 连接失败

demo仓库:https://github.com/WankkoRee/go-http3-proxy


我希望通过 QUIC 的双向连接特性来实现端口穿透,即:客户端在主动访问服务端后,服务端通过已经建立起的 QUIC 连接,可以访问客户端上的服务。

未使用代理,本机直连,测试情况符合预期:

image

未使用代理,客户端位于容器内(模拟NAT网络环境),测试情况符合预期:

image

使用代理,本机直连,测试发现会变成单向连接:

image

我现在的需求是使用 Socks5 代理完成双向 QUIC 连接,我应该怎么改动我的代码?


我尝试过复写Dialer.ProxyPacketDial直接返回客户端服务的PacketConn,但是发现会报错连接已存在。

handleAssociate

hi,
nice package! thx alot!

there is a problem in: handleAssociate

seems like it returns ipv6 address and port 0

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

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.