goncpage

Introduction to go-netcat

README in English and 中文

go-netcat is a Golang-based netcat tool designed to facilitate peer-to-peer communication. Its main features include:


Latest version download


Usage Examples

Basic Usage

Secure Encrypted P2P Communication

Reverse Shell (Pseudo-Terminal Support for UNIX-like Systems)

Transmission Speed Test

P2P Tunnel and Socks5 Proxy

P2P Tunnel and HTTP File Server

Flexible Service Configuration

Socks5 Proxy Service

Establishing a Tunnel for Other Applications

P2P NAT Traversal Capabilities

How does gonc establish a P2P connection?

How to Deploy a Relay Server for Cases Where P2P Is Not Feasible

For example, if both peers are behind symmetric NATs and P2P fails, having just one side use a SOCKS5 UDP relay effectively changes its NAT behavior to “easy,” making it much easier to establish a connection. The data remains end-to-end encrypted.

Used public servers(STUN & MQTT):

	"tcp://turn.cloudflare.com:80",
	"udp://turn.cloudflare.com:53",
	"udp://stun.l.google.com:19302",
	"udp://stun.miwifi.com:3478",
	"global.turn.twilio.com:3478",
	"stun.nextcloud.com:443",
“tcp://broker.hivemq.com:1883”,
	"tcp://broker.emqx.io:1883",
	"tcp://test.mosquitto.org:1883",

How effective is gonc at NAT traversal?

Except in symmetric NAT scenarios on both ends, gonc achieves a very high success rate

gonc classifies NAT types into three categories:

  1. Easy: A single internal port maps to the same external port across multiple STUN servers

  2. Hard: A single internal port maps to a consistent but different external port across STUN servers — harder than type 1

  3. Symmetric: A single internal port maps to different external ports depending on the destination — the most difficult type

To handle these NAT types, gonc employs several traversal strategies: