Giter Site home page Giter Site logo

htunnel's Introduction

htunnel

A simple HTTP Tunnel written in Java to encapsulate any TCP/IP connection and pass through HTTP proxies.

It is typically used to perform SSH connections behind a corporate HTTP proxy that does not accept CONNECT method.

It consists of a client module (htunnel-client) to be installed in the private network behind the HTTP proxy and a server module (htunnel-server) to be installed anywere on the Internet.

 ----------------------------------------------------------------   -----------------------------------------------
| Corporate Network                                              | | Internet                                      | 
|                                                                | |                                               |
|  --------------------------------------------                  | |                                               |
| | Employee PC                                |                 | |                                               |
| |                                            |                                                                   |
| |  ------------   TCP/IP   ----------------  | HTTP   -------  HTTP   ----------------   TCP/IP   ------------   |
| | | SSH Client |--------->| htunnel-client |-------->| Proxy |------>| htunnel-server |--------->| SSH Server |  |
| |  ------------            ----------------  |        -------         ----------------            ------------   |
| |                                            |                 | |                                               |
|  --------------------------------------------                  | |                                               |
|                                                                | |                                               |
 ----------------------------------------------------------------   -----------------------------------------------

Build

The source code is written in Java and can be built with Apache Maven. Perform the following command in the root directory:

mvn clean install

This will produce 2 jar files:

  • htunnel-client/target/htunnel-client-version.jar
  • htunnel-server/target/htunnel-server-version.jar

Usage

htunnel-server

Run htunnel-server on any machine in the Internet:

java -jar htunnel-server-version.jar

It will start a HTTP server on port 8080.

You can change port number with option --server.port:

java -jar htunnel-server-version.jar --server.port=80

htunnel-client

Run htunnel-client on any machine in the corporate network:

java -jar htunnel-client-version.jar --target=sshhost:sshport --tunnel=http://tunnelhost:8080/ --proxy=http://proxyhost:proxyport/

It will start the client daemon on port 3000. Any communication made with htunnel client will be transferred to the specified target.

You can change port number with option --port:

java -jar htunnel-client-version.jar --port=4000 --target=sshhost:sshport --tunnel=http://tunnelhost:8080/ --proxy=http://proxyhost:proxyport/

If the proxy requires authentication you can specify a user and password in the proxy url: --proxy=http://username:pasword@proxyhost:proxyport/

Finally perform SSH connection:

ssh -p 3000 localhost

htunnel's People

Contributors

nicolas-dutertry avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.