tcphttp-server

TCP-over-HTTP server: Clients can use it with curl and perhaps browser

MIT License

Downloads
29
Stars
5

tcphttp-server

TCP over HTTP server

Quick Start

Here is examples to show how to use TCP over HTTP. Actually, the following examples show "HTTP over HTTPS" and "HTTPS over HTTPS".

Here is an example to request to example.com.

curl --data-binary @- 'https://tcphttp.glitch.me?host=example.com&port=80' <<EOS
GET / HTTP/1.1
Host: example.com
Connection: close


EOS

Here is an example to use HTTPS.

curl --data-binary @- 'https://tcphttp.glitch.me?host=example.com&port=443&tls' <<EOS
GET / HTTP/1.1
Host: example.com
Connection: close


EOS

Connection Flow

Run Server

Way 1: Run server on Heroku

Click the button below and run a server.

Way 2: Run server on Docker

Run a tcphttp-server on http://localhost:8181 by the following command.

docker run -p 8181:8080 nwtgck/tcphttp-server

You can also specify options as follows.

docker run -p 8181:80 nwtgck/tcphttp-server --http-port=80

Way 3: Run server with npm

Install tcphttp-server as command as follows.

npm install -g tcphttp-server

Then, run a server as follows.

tcphttp-server --http-port=8181

Way 4: Run server from source

Run a server from the latest source.

# Clone this repository
git clone https://github.com/nwtgck/tcphttp-server.git
# Go to the directory
cd tcphttp-server
# Install dependencies
npm install
# Run a server
npm start