Giter Club home page Giter Club logo

ktun's Introduction

ktun

ktun establishes http reverse tunnels over WebScoket connections for circumventing the problem of directly connect to hosts behind a strict firewall or without public IP

  • Reverse http tunnel over websocket
  • Expose service running behind firewall with access token
  • Http request

Usage

Use docker image moon/ktun:<version>

Setup tunnel server

Start a tunnel server (on port 8080), on publicly accessible host.

ktun -p 8080

Start tunnel

If public domain name of tunnel server is ktun.example.com, ktun client can connect the server to reverse proxy service behind firewall.

ktun -t mysecrettoken -r localhost:7777 -s ws://ktun.example.com

ktun client request a new tunnel to server (with secret token 'mysecrettoken'), and reverse proxy request from server to service behind firewall localhost:7777.

Make a request through the tunnel

$ curl 'http://ktun.example.com:8080/_ktun/my_b!g_$secret/some/web/page'
$ curl '-HX-Ktun-Token: mysecrettoken' http://wstun.example.com:8080/some/web/page

http request to http://wstun.example.com/_ktun/mysecrettoken/ will be forwarded to service running behind firewall (localhost:7777) through the tunnel.

      HTTP-client ==>\     ||firewall||     /===> HTTP-server
                     |                      | (localhost:7777)
                     \----------------------/
                Ktun     <===tunnel====    Ktun
          (tunnel-server.com)            (client)

This connection mechanism is inspired by wstunnel. However, wstunnel does not handle websocket request. This project uses wstun to create tcp tunnel over websocket and node-http-proxy to reverse proxy request. And it handles websocket connection smoothly.

ktun's People

Contributors

leemoonsoo avatar

Stargazers

 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.