GithubHelp home page GithubHelp logo

odianosen25 / http-tunnel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from khuevu/http-tunnel

0.0 1.0 0.0 22 KB

Tunnel tcp connection through http in Python

License: MIT License

Python 98.04% Dockerfile 1.96%

http-tunnel's Introduction

HTTP TUNNEL

A program to tunnel TCP connection through HTTP connection

Usage:

The program is useful when you has a client behind a firewall which only allows HTTP connections or connections to standard ports such as port 80 of HTTP. You will need a remote server outside of the firewall.

Tunnel Server

Start the tunneld server on a remote machine. The server listens on a port specified by parameter -p for HTTP connection from a client program.

python tunneld.py -p <listen_port> 

The server then read the HTTP payload and send it to the target using TCP connection. The target is specified by the client when establishing the tunnel.

Usually, tunneling will actually be useful when you use the default HTTP port 80 so that the connection from tunnel client to tunnel server is not blocked by firewall.

Tunnel Client

Start the tunnel client which listen on the local machine. The command needs local port parameter, the remote tunnel server and its port, and the target that the client want to connect to.

python tunnel.py -p <client_port> -r <tunnel_server_host>:<tunnel_server_port> <target_host>:<target_port>

When this command is executed, the client sends a http request to establish the tunnel with the remote tunnel server. The tunnel server will then establish a TCP connection with the target server.

Example

To connect to irc server using the tunnel:

# 1. on server machine (remote_host)
python tunneld.py -p 80

# 2. on client machine: 
python tunnel.py -p 8765 -r remote_host:80 irc.freenode.net:6667

# 3. on the client machine, test the tunnel connection using netcat
nc 127.0.0.1 8765
# send irc NICK command to the connection and see the response back from
the irc server
NICK abc

Credit:

This project was inspired by supertunnel project

http-tunnel's People

Contributors

bitdeli-chef avatar franciosi avatar jadolg avatar jeffliu avatar khuevu avatar unusedaccount avatar

Watchers

 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.