wuhuizuo / tcpb

tcp bridge under websocket protocol.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TCPB

TCP Bridge under HTTP protocol.

websocket tunnel side/client implmented with go websocket gorilla/websocket http connect/post tunnel server directly using envoy, only implmented tunnel client in my repo.

Usage

start up tcp server and envoy tunnel server side

docker-compose -f .docker/docker-compose.yml up -d

start tunnel client side

# tunnel remote tcp to local port 10001

# http post tunnel, using config in docker-compose.yaml: /etc/envoy/envoy_post.yaml
go run ./cmd/client/ --tunnel=http://127.0.0.1:10000 -port 10001 --method=POST

# http connect tunnel, using config in docker-compose.yaml: /etc/envoy/envoy_connect.yaml
# go run ./cmd/client/ --tunnel=http://127.0.0.1:10000 -port 10001

test with tcp client

test envoy encapsulate tcp server:

# type STOP to exist.
go run ./cmd/test-tool --addr 127.0.0.1:20000

test with tunnel client function:

# type STOP to exist.
go run ./cmd/test-tool --addr 127.0.0.1:10001

test websocket client/side:

# terminal 1
go run ./cmd/server/ -port 30000
# terminal 2
go run ./cmd/client/ --tunnel=ws://127.0.0.1:30000/127.0.0.1:20000 -port 10001
# terminal 3
go run ./cmd/test-tool --addr 127.0.0.1:10001

About

tcp bridge under websocket protocol.

License:MIT License


Languages

Language:Go 96.7%Language:Makefile 2.1%Language:Dockerfile 1.2%