Giter Club home page Giter Club logo

socks-router's Introduction

socks-router

Thin facade layer on top of openssh's dynamic proxy with slightly more sophiscated configurable routing rules

Usage

socks-router --help

Routing Table

Grammar

routing_table := "" | comment | routing_rule [[comment] end_of_line routing_table]
routing_rule := upstream_address whitespaces patterns
comment := [whitespaces] "#"  [whitespaces] .*

upstream_address := [upstream_scheme "://"] address
address := ipv4_address | ipv6_address | host_address

upstream_scheme := "ssh" | "socks5" | "socks5h"

patterns := pattern [whitespaces patterns]
pattern := ["!"] "[^ \t\r\n]+"

ipv4_address := ipv4 [":" port]
ipv6_address := ("[" ipv6 "]:" port) | ipv6
host_address := host [":" port]

whitespaces := whitespace | whitespaces
whitespace := " " | "\t"
end_of_line := "\r\n" | "\r" | "\n"

Example

# ~/.ssh/routes

# default upstream scheme: ssh://
# use ssh host foo's dynamic proxy to connect to bar.com
foo bar.com
# use ssh host foo's dynamic proxy to connect to *.bar.com
foo *.bar.com
# use ssh host foo's dynamic proxy to connect to *.google.com but abc.bar.com
foo *.bar.com !abc.bar.com
ssh://foo *.google.com

# transparent socks5 / socks5h upstreams
# perform DNS resolution in socks-router
socks5://foo-bar.baz hello-world.com
# defer the DNS resolution to upstream
socks5h://foo-bar.baz hello-world.com

Development

poetry install

poetry run pytest --cov-report html

NOTE: pre-commit hooks are set up

socks-router's People

Contributors

github-actions[bot] avatar leoslf avatar

Stargazers

 avatar

Watchers

 avatar

socks-router's Issues

filedescriptor out of range in select()

Version
v0.1.0

Describe the bug
The socks-router will have file descriptors run out of range after running for several weeks.

To Reproduce
Steps to reproduce the behaviour:

  1. Run the socks-router for around 3 weeks
  2. Look at the logs
  3. See error

Expected behaviour
The socks-router should not have

Environment (please complete the following information):

  • OS: CentOS
  • Version 7.9.2009

Additional context
N/A

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.