All Projects → enthus1ast → nimSocks

enthus1ast / nimSocks

Licence: MIT license
A filtering SOCKS proxy server and client library written in nim.

Programming Languages

nim
578 projects

Projects that are alternatives of or similar to nimSocks

3proxy
3proxy - tiny free proxy server
Stars: ✭ 2,263 (+4337.25%)
Mutual labels:  proxy-server, socks, socks5, socks-proxy, socks4a, socks4
3proxy
3proxy - tiny free proxy server
Stars: ✭ 2,493 (+4788.24%)
Mutual labels:  proxy-server, socks, socks5, socks-proxy, socks4a, socks4
Prox5
🧮 SOCKS5/4/4a 🌾 validating proxy pool and upstream SOCKS5 server for 🤽 LOLXDsoRANDum connections 🎋
Stars: ✭ 39 (-23.53%)
Mutual labels:  proxy-server, socks, socks5, socks4a, socks4
microsocks11
A cross-platform SOCKS5 library and server based on the microsocks project.
Stars: ✭ 22 (-56.86%)
Mutual labels:  proxy-server, socks, socks5, socks-proxy
Tor Socks Proxy
🐳 Tiny Docker(🤏 10MB) image as 🧅 Tor SOCKS5 proxy 🛡
Stars: ✭ 218 (+327.45%)
Mutual labels:  proxy-server, socks, socks5, socks-proxy
socks5 list
Auto-updated SOCKS5 proxy list + proxies for Telegram
Stars: ✭ 210 (+311.76%)
Mutual labels:  proxy-server, socks, socks5, socks-proxy
Flynet
A powerful TCP/UDP tool, which support socks5 proxy by tcp and udp, http proxy and NAT traversal. This tool can help you bypass gfw easily
Stars: ✭ 124 (+143.14%)
Mutual labels:  proxy-server, socks, socks5, socks-proxy
Psiphon
A multi-functional version of a popular network circumvention tool
Stars: ✭ 169 (+231.37%)
Mutual labels:  proxy-server, socks, socks5
python-socks
Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python
Stars: ✭ 40 (-21.57%)
Mutual labels:  socks, socks5, socks4
rsp
Rapid SSH Proxy
Stars: ✭ 223 (+337.25%)
Mutual labels:  socks, socks5, socks-proxy
Socks
Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.
Stars: ✭ 200 (+292.16%)
Mutual labels:  socks, socks5, socks-proxy
Socksio
Sans-I/O implementation of SOCKS4, SOCKS4A, and SOCKS5
Stars: ✭ 27 (-47.06%)
Mutual labels:  socks, socks5, socks-proxy
LiveProxies
Asynchronous proxy checker
Stars: ✭ 17 (-66.67%)
Mutual labels:  proxy-server, socks5, socks4a
SocksSharp
SocksSharp provides support for Socks4/4a/5 proxy servers to HttpClient
Stars: ✭ 75 (+47.06%)
Mutual labels:  socks5, socks4a, socks4
Socks5
A full-fledged high-performance socks5 proxy server written in C#. Plugin support included.
Stars: ✭ 331 (+549.02%)
Mutual labels:  proxy-server, socks, socks5
asyncio-socks-server
A SOCKS proxy server implemented with the powerful python cooperative concurrency framework asyncio.
Stars: ✭ 154 (+201.96%)
Mutual labels:  proxy-server, socks, socks5
Socks5
A full-fledged high-performance socks5 proxy server written in C#. Plugin support included.
Stars: ✭ 286 (+460.78%)
Mutual labels:  proxy-server, socks, socks5
Proxybroker
Proxy [Finder | Checker | Server]. HTTP(S) & SOCKS 🎭
Stars: ✭ 2,767 (+5325.49%)
Mutual labels:  proxy-server, socks
ar-search
Provides unified search model for Yii ActiveRecord
Stars: ✭ 31 (-39.22%)
Mutual labels:  filter, filtering
Mubeng
An incredibly fast proxy checker & IP rotator with ease.
Stars: ✭ 234 (+358.82%)
Mutual labels:  proxy-server, socks5

nimSocks

a filtering (standalone) SOCKS proxy server and client library for nim.

Features client and server

  • (SOCKS4, SOCKS4a server only), SOCKS5
  • password auth / no auth
  • ipv4, ipv6, domain.
  • SOCKS CONNECT (no bind, no udp atm)
  • domain target white/black-listing
  • static hosts

SOCKS Compatibility Table

Socks Version TCP UDP IPv4 IPv6 Hostname
SOCKS v4
SOCKS v4a
SOCKS v5

nimSocks implementation

lib TCP connect TCP accociate UDP bind
server
client
lib SOCKS v4 SOCKS v4a SOCKS v5
server
client
auth no auth user/password
server
client

server

usage

  import nimSocks/server
  var proxy = newSocksServer()
  echo "SOCKS Proxy listens on: ", proxy.listenPort
  proxy.allowedSocksVersions = {SOCKS_V4, SOCKS_V5}
  proxy.allowedAuthMethods = {USERNAME_PASSWORD, NO_AUTHENTICATION_REQUIRED}

  ## Add a valid user / password combination
  proxy.addUser("hans", "peter")

  ## For a static host replacement:
  proxy.staticHosts.add("peter.peter", "example.org")

  asyncCheck proxy.serve()
  asyncCheck proxy.dumpThroughput()
  runForever()

black and whitelisting example filter file

(full domain match only)

for a good blacklist file use https://raw.githubusercontent.com/notracking/hosts-blocklists/master/dnscrypt-proxy/dnscrypt-proxy.blacklist.txt

files

  • whitelist.txt
  • blacklist.txt
nim-lang.org
forum.nim-lang.org

example "fancy" filter

files

  • whitelistFancy.txt
  • blacklistFancy.txt

# '#' is a comment

# all domains containing nim
con nim

# ending with
end nim-lang.org
end wikipedia.org

# exact match
eql github.org

# startswith
sta foo.baa

if there are whitelist* entries the blacklist* gets skipped!

static hosts

fill the staticHosts table to always resolve to given ip/dns

#...
proxy.staticHosts.add("foo.loc", "example.org")
proxy.staticHosts.add("baa.loc", "192.168.1.1")
#...

client

the client can "upgrade" your socket.

var sock = waitFor asyncnet.dial("127.0.0.1", Port 1080 ) # dial to the socks server 
assert true == waitFor sock.doSocksHandshake(
    username="username", 
    password="password", 
    methods={NO_AUTHENTICATION_REQUIRED, USERNAME_PASSWORD} # the "best" auth supported gets choosen by the server!
    ) 
assert true == waitFor sock.doSocksConnect("example.org", Port 80) # instruct the proxy to connect to target host (by tcp)

# Then do normal socket operations
sock.send("FOO")

proxy hopping

you could easily do "proxy hopping", by letting the first SOCKS server connect to the next, then do handshake, connect, etc.

var sock = waitFor asyncnet.dial("firstSocks.loc", Port 1080 )
assert true == waitFor sock.doSocksHandshake(methods={NO_AUTHENTICATION_REQUIRED})
assert true == waitFor sock.doSocksConnect("secondSocks.loc", Port 1080) 

assert true == waitFor sock.doSocksHandshake(methods={NO_AUTHENTICATION_REQUIRED})
assert true == waitFor sock.doSocksConnect("mytarget.loc", Port 80) 

sock.send("FOO") # from here we speak to "mytarget.loc"
sock.close() # will destroy the whole tunnel

random examples

$ ncat --proxy 127.0.0.1:1080 --proxy-type socks5 --proxy-auth hans:peter  2a02:bbb:aaa:9daa:ff11:a4ff:aaaa:bbbb 9090
$ curl --socks5-basic --socks5 hans:[email protected]:1080 google.de
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].