tun2socks icon indicating copy to clipboard operation
tun2socks copied to clipboard

[Feature] Instructions for a local socks proxy

Open iopq opened this issue 2 years ago • 3 comments

Description

I think the sample configuration might be breaking my local proxy since it affects its own routing

Is this feature related to a specific bug?

No response

Do you have a specific solution in mind?

Include a sample config to use with an already existing proxy running on the same machine

iopq avatar Aug 16 '22 19:08 iopq

https://dev.to/jadolg/tunneling-all-your-internet-connections-through-a-socks-proxy-4f5i

the step that's missing for me is ensuring the local proxy still connects through the default gateway

ip r a $server_ip via $default_gateway

iopq avatar Aug 17 '22 09:08 iopq

https://dev.to/jadolg/tunneling-all-your-internet-connections-through-a-socks-proxy-4f5i

I saw this website so I adapted some of the steps, here are all of them:

  sudo ip tuntap add mode tun dev tun0
  sudo ip addr add 198.18.0.1/15 dev tun0
  sudo ip link set dev tun0 up
  
  curl --socks5 socks5://localhost:1080 https://myip.wtf/json
  
  sudo ip route del default
  sudo ip route add default via 198.18.0.1 dev tun0 metric 1
  sudo ip route add default via $your_gateway dev wlp38s0 metric 10

  sudo ip r a $remote_proxy_address via $your_gateway
  tun2socks -device tun0 -proxy socks5://127.0.0.1:1080 -interface wlp38s0

where wlp38s0 is my wifi interface

iopq avatar Aug 18 '22 05:08 iopq

  tun2socks -device tun0 -proxy socks5://127.0.0.1:1080 -interface wlp38s0

where wlp38s0 is my wifi interface

No, see:

  • https://github.com/xjasonlyu/tun2socks/issues/165#issuecomment-1247586773

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Nov 20 '22 10:11 github-actions[bot]

Did anyone get this working with a local socks proxy? I can't seem to avoid looping after trying a few different suggestions.

jseparovic avatar May 11 '23 07:05 jseparovic

The best implementation is here

https://github.com/v2rayA/v2rayA/blob/25975fb8e57a882fa5147ab93a6974317ebcdfba/service/core/iptables/tproxy.go#L68

I just switched to using this program directly, but using a fork for xray

iopq avatar May 11 '23 09:05 iopq