GithubHelp home page GithubHelp logo

tcp-over-http's Introduction

tcp-over-http

This program is just a proxy server which multiplexes TCP connections into an HTTPS. The primary purpose is to make all connections look like legitimate ones for firewalls (including DPI).

The closest analog is shadowsocks.

The only reason why I wrote this is that I want to have better control on how the connections are masked/multiplexed.

Current status

This software is unstable and non-unique. The code is broken in many places and follows the worst coding practices. It is not recommended to use this piece.

Setup

First, clone the repo and build all binaries (go install ./...). You may install it with go get github.com/neex/tcp-over-http as well, but the idea that you won't need source modifications is way too optimistic.

Server (do this before your trip)

  1. Buy a domain name (e.g. example.com).
  2. Rent a VPS. Make sure not to use any popular VPS provider (e.g. DigitalOcean/Vultr/Scaleway) as they're banned in some countries almost completely.
  3. Set up DNS A record pointing to the VPS.
  4. Get a LetsEncrypt certificate using certbot (apt install certbot && certbot -d example.com).
  5. Get something legitimate-looking to place on your website, like free bootstrap template.
  6. Create a config for the server part in /etc/tcp-over-http.yaml, it should look like this:
    listen_addr: ':443'
    static_dir: /var/www/html/
    dial_timeout: 2m
    token: <put a random token here>
    domain: <example.com>
    redirector_addr: ':80'
    cert_path: /etc/letsencrypt/live/<example.com>/fullchain.pem
    key_path: /etc/letsencrypt/live/<example.com>/privkey.pem
  7. Create systemd module in /etc/systemd/system/tcp-over-http.service:
    [Unit]
    Description=TCP over HTTP
    
    [Service]
    Type=simple
    Restart=always
    ExecStart=/usr/local/bin/tcp_over_http_server /etc/tcp-over-http.yaml
    LimitNOFILE=100000
    
    [Install]
    WantedBy=multi-user.target
  8. Do systemctl daemon-reload && systemctl start tcp-over-http.
  9. Debug errors in journalctl, if any.

Client (test this before your trip)

  1. Create a client config, should like like:

    address: "https://<example.com>/establish/<token-from-server-config>"
    dns_override: <vps ip>:443
    remote_timeout: 30s
    connect_timeout: 10s
    max_connection_multiplex: 1000
    keep_alive_timeout: 10s
  2. Start the client using something like

    tcp_over_http --config ./client.yaml proxy :12321 --direct-dial '127.0.0.1|localhost'

    This command starts socks5 server on :12321, which runs through the tunnel.

  3. Under linux, you can setup an interface that proxies the connections. Do it like this:

    sudo ip tuntap add user <your username> mode tun hui0
    sudo ip link set hui0 up

    After that, run tcp-over-http with --tun hui0 flag. No server reconfiguration is required.

    Note that this is not an actual VPN. The connections are intercepted and proxies as TCP/UDP streams.

    Also, you will need to set up routes correctly.

License

This software is distributed under the terms of MIT License.

tcp-over-http's People

Contributors

neex avatar

Watchers

James Cloos avatar

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.