Coder Social home page Coder Social logo

httptun's Introduction

httptun

A Simple Tunnel let TCP connection looks like HTTP request. Server side also with a simple web/file server. For the normal browser, the server side is just a website. Suggest using long connection(Multiplexing/VPN) with this tool.

Warning: No encrypted connections between server and client !!!

You should use TLS or something similar first, and then go through this tool.

now support HTTPS/TLS server!

overhead

  • 3 http requset for initial
    • ws mode: 2 http requset
  • 2 tcp connection for data transmission
    • ws mode: 1 tcp connection

Usage

Client: ./httptun-client -t "HTTPTUN_SERVER_IP:4040" -p ":5005"
Server: ./httptun-server -t "TARGET_IP:5005" -p ":4040"

The above commands will establish port forwarding for 8388/tcp as:

Application -> httptun Client(5005/tcp) -> httptun Server(4040/http) -> Target Server(5005/tcp)

Tunnels the original connection:

Application -> Target Server(5005/tcp)

Code Usage

server side:

	// simple http Handler setup
	fileHandler := http.FileServer(http.Dir(*dir))
	//http.Handle("/", fileHandler) // do not add to http.DefaultServeMux now
	http.HandleFunc("/hello", func(w http.ResponseWriter, r *http.Request) { // other Handler
		io.WriteString(w, "Hello, world!\n")
	})

	websrv := fakehttp.NewHandle(fileHandler) // bind handler
	websrv.UseWs = true
	websrv.OnlyWs = false
	http.Handle("/", websrv) // now add to http.DefaultServeMux

	// start http server
	http.ListenAndServe(":8080", nil)

httptun's People

Contributors

cs8425 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

free-language

httptun's Issues

Help , please.

Hello @cs8425 .
My name is Nelson . Here in my country we have a firewall does not let us visit any websites . I am not a programmer , but I know the restrictions about the ISP providers . Could help me to create a client and server in golang to bypass the firewall and search or visit any websites , please ?
The Http tunnel that I need this :

  1. client has to send only http request to the server .
  2. Any data that the client has to send or transfer to the server should be via a new "HTTP request" encoding it on the url path or a http header and not via "http body", because the firewall blocks the Connection when the Upstream is more than 50 bytes on "http body".

I know it is not normal connection , but this is the only way . Someone created a android app that do this ,but he sell it to us a monthly account to visit any websites :(
I captured the package using TCPDUMP , you can see it using WIRESHARK program on PC.

Look:
IMG_20200903_141246_483

This is the packet I captured using TCPDUMP:
quantumnica1.zip

Would you help me ? . I am sure you can do it , if you say yes , can we get in touch using telegram to chat more easy ?

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.