Giter VIP home page Giter VIP logo

socks5-wireguard's Introduction

Socks5-wireguard

This repository presents how you can direct all traffic from proxy to WireGuard.

Generate keys for WireGuard

umask 077; wg genkey | tee privatekey | wg pubkey > publickey
cat privatekey
cat publickey

Enable masquerade on server

nft add table nat
nft 'add chain nat postrouting { type nat hook postrouting priority 100 ; }'
nft add rule nat postrouting masquerade

Start proxy server

For start proxy use this command:

docker run \
    --rm -d \
    --name=wireguard-socks-proxy-0 \
    -p 0.0.0.0:1900:1080 \
    -p 41100:40000/udp \
    -e WG_ADDRESS='10.0.0.1/32' \
    -e WG_SERVER_PRIVATE_KEY='6Gp7b6JPSpTony2tQtEF1wGJHMa3VptoMCy+BGHnInI=' \
    -e WG_CLIENT_PUBLIC_KEY='x/WxCyDTn50an4zINhsnRESBMI3Zwnm6A0l4+/H9eAc=' \
    -e PROXY_LOGIN='some_login' \
    -e PROXY_PASSWORD='some_password' \
    --privileged=1 \
    allngth/socks5-wireguard
  • 0.0.0.0:1900:1080 - direct all traffic from external 1900 port to socks5 proxy inside docker container
  • 41100:40000/udp - used to establish connection between your server inside docker container and client
  • WG_ADDRESS - docker container VPN tunnel address
  • WG_SERVER_PRIVATE_KEY - docker container VPN private key (generates on step before)
  • WG_CLIENT_PUBLIC_KEY - client VPN public key (generates on client side)
  • PROXY_LOGIN - optional, proxy login
  • PROXY_PASSWORD - optional, proxy password

socks5-wireguard's People

Contributors

allngth avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

essoojay

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.