YAL-Tools / tiny-tunnel

Repository from Github https://github.comYAL-Tools/tiny-tunnelRepository from Github https://github.comYAL-Tools/tiny-tunnel

A tiny tunnel server!

This is a node.js app that solves a specific annoyance: playing games between two computers that cannot connect over P2P, even with hole-punching.

Text form
Application Device
game (client) PC1
tiny-tunnel (--guest)
tiny-tunnel (--relay) Relay
tiny-tunnel (--host) PC2
game (server)

Building

Install Haxe if you don't have it;

haxe build.hxml

This creates bin/tiny-tunnel.js

Running

You'll need node.js installed. Any semi-recent version should do.

Open a command prompt / terminal in the bin directory or copy tiny-tunnel.js wherever you'd like.

Relay

node tiny-tunnel.js --relay --host-port 9000 --guest-port 9001

--host-port port

The port for the host player (the one hosting a game server) to connect to.

--guest-port port

The port for the guest player (the one joining a game server) to connect to.

Host

node tiny-tunnel.js --host --relay-ip 127.0.0.1 --relay-port 9000 --connect-port 7800

--relay-ip address

The IP address of the relay.

--relay-port port

The relay port to connect to (see --host-port above).

--connect-port port

The port where a game server is hosted.

--connect-ip address

If the game server is hosted on another computer (e.g. a home server without internet access), you can use this.

Otherwise the app will attempt connect to a server on localhost / 127.0.0.1.

Guest

node tiny-tunnel.js --guest --relay-ip 127.0.0.1 --relay-port 9001 --server-port 7700

--relay-ip address

The IP address of the relay.

--relay-port port

The relay port to connect to (see --guest-port above).

--server-port port

The port to host a local server on.

When a game connects to this port, a local client will be created on the host's side to connect to the game server and data will be forwarded back and forth.

When the guest's local client disconnects or the host destroys the client, the local client on the other side will be destroyed.

Limitations

Only TCP protocol is supported.

About


Languages

Language:Haxe 99.8%Language:Shell 0.2%