Git Product home page Git Product logo

daniilsokolyuk / go-pcap2socks Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 2.0 158 KB

go-pcap2socks functions like a router, allowing you to connect various devices such as an XBOX, PlayStation (PS4, PS5), Nintendo Switch, mobile phones, printers and others to any SOCKS5 proxy server. Additionally, you can host a SOCKS5 proxy server on the same PC to use services like a VPN or a game booster/accelerator for reduced latency

License: GNU General Public License v3.0

Go 100.00%
go socks5 tun2socks tunnel virtual-router vlan gvisor nat network pcap

go-pcap2socks's Introduction

go-pcap2socks

go-pcap2socks is a proxy that redirects traffic from any device to a SOCKS5 proxy.

go-pcap2socks functions like a router, allowing you to connect various devices such as an XBOX, PlayStation (PS4, PS5), Nintendo Switch, mobile phones, printers and others to any SOCKS5 proxy server. Additionally, you can host a SOCKS5 proxy server on the same PC to use services like a VPN or a game booster/accelerator for reduced latency, you can also share a working VPN from your computer to your mobile phone.

Dependencies

For Windows, install Npcap or WinPcap. If you choose Npcap, ensure to install it in "WinPcap API-compatible Mode". For macOS, Linux, and other operating systems, use libpcap.

Config

Config example is here

Credits

go-pcap2socks's People

Contributors

daniilsokolyuk avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

chaos-zhu 888001

go-pcap2socks's Issues

Switch only have connections to IP addresses, not domains

I use my Mac as go-pcap2socks client and have my Switch connected to it, but I found out switch will only request IP addresses, instead of domains.
This is the logs of go-pcap2socks:

2024/05/23 16:16:18 INFO [UDP] Connection closed source=172.24.114.2:56632 dest=35.74.126.33:33334
2024/05/23 16:16:18 INFO [UDP] Connection source=172.24.114.2:32667 dest=8.8.8.8:53
2024/05/23 16:16:18 INFO [UDP] Connection source=172.24.114.2:26106 dest=104.198.251.169:34343
2024/05/23 16:16:18 INFO [TCP] Connection source=172.24.114.2:49547 dest=54.144.191.108:443
2024/05/23 16:16:22 INFO [TCP] Connection source=172.24.114.2:21141 dest=54.144.191.108:443
2024/05/23 16:16:27 INFO [UDP] Connection source=172.24.114.2:36339 dest=8.8.8.8:53
2024/05/23 16:16:29 INFO [UDP] Connection source=172.24.114.2:56449 dest=8.8.8.8:53
2024/05/23 16:16:30 INFO [UDP] Connection source=172.24.114.2:65101 dest=35.74.126.33:33334
2024/05/23 16:16:30 INFO [UDP] Connection source=172.24.114.2:13691 dest=104.198.251.169:34343
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:53744 dest=[::]:52940 error="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:36339 dest=[::]:58752 error="io: read/write on closed pipe"
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:36339 dest=8.8.8.8:53
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:13691 dest=[::]:49304 error="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:56449 dest=[::]:53312 error="io: read/write on closed pipe"
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:13691 dest=104.198.251.169:34343
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:56449 dest=8.8.8.8:53
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:32667 dest=[::]:54509 error="io: read/write on closed pipe"
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:32667 dest=8.8.8.8:53
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:26106 dest=[::]:63154 error="io: read/write on closed pipe"
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:26106 dest=104.198.251.169:34343
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:53744 dest=35.74.126.33:33334
2024/05/23 16:22:08 INFO [UDP] Connection source=172.24.114.2:42061 dest=8.8.8.8:53
2024/05/23 16:22:08 INFO [UDP] Connection source=172.24.114.2:13691 dest=104.198.251.169:34343
2024/05/23 16:22:09 INFO [TCP] Connection source=172.24.114.2:43158 dest=35.170.126.178:443

This is my config file I use:

{
  "pcap": {
    "network": "172.24.0.0/16",
    "localIP": "172.24.114.1"
  },
  "routing": {
    "rules": [
      {
        "outboundTag": "dir"
      }
    ]
  },
  "outbounds": [
    {
      "tag": "",
      "socks": {
        "address": "127.0.0.1:1078",
        "username": "",
        "password": ""
      }
    },
    {
      "tag": "dir",
      "direct": {}
    }
  ]
}

Network settings on Switch:

  • IP: 172.24.114.51
  • Subnet mask: 255.255.255.0
  • Gateway: 172.24.114.1
  • DNS: 8.8.8.8, 8.8.4.4

Do this work for animal crossing on a CFW switch?

As the title says, I'm curious to know if this works for Animal Crossing (with ldn_mitm) and how could I setup it properly ๐Ÿ˜…
I've tried to take a look the config example but I don't understand where the dstPort comes from or what the outboundTag means (so I've removed lol)

Also I'm not sure how can my friends from another networks can play with me? Everyone would need to use some service such as ZeroTier/Radmin/Hamachi and host a local proxy or they need connect directly into my proxy in their Nintendo Switch?

This is my current settings, tried to make a friend join my proxy but don't seems to connect?

{
  "pcap": {
    "network": "192.168.16.0/16",
    "localIP": "192.168.15.1"
  },
  "routing": {
    "rules": []
  },
  "outbounds": [
    {
      "tag": "",
      "socks": {
        "address": "[my public ip]:10086",
	"username": "",
        "password": ""
      }
    }
  ]
}
  • 192.168.15.1 is the IP for my (original) router
  • My router give 192.168.15.x IPs so I've used 192.168.16.X just to differentiate a bit, but like I said before, I'm not sure what I'm doing at all LOL

I hope this can make we play together cause we've tried lan-play and for some reason we can't get it to work, so that's the only alternative I've found

Questions about dstPort and srcPort from routing

Hi.
What are these two and how should I set it?
And it keeps prompting "2024/04/17 00:11:13 WARN [UDP] dial error: error="proxy not found"", why?
My config file is as below:

{
"pcap": {
"network": "10.10.0.0/24",
"localIP": "10.10.0.1"
},
"routing": {
"rules": [
{
"srcPort": "80,443,53,3544,1985,55960,4500,500,3075,1900,5355,5353",
"dstPort": "3074",
"outboundTag": "sout"
},
{
"srcIP": [
"10.10.0.0/24"
],
"dstIP": [
"0.0.0.0/0"

    ]
  }
]

},
"outbounds": [

{
  "tag": "sout",
  "socks": {
    "address": "127.0.0.1:50325"
  }
}

]
}

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.