goncpage

Introduction to gonc

README in English and 中文

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


Latest version download


Usage Examples

Basic Usage

P2P Tunnel and HTTP File Server

  1. Automatically download the entire directory

    After running the following command, all files will be downloaded recursively to the local machine. If the process is interrupted, re-running the command will automatically resume from where it left off:

     gonc -p2p <passphrase> -download c:/SavePath
    
  2. Browse and selectively download via browser

    This option does not start downloading automatically. Instead, you need to manually open a browser and visit http://127.0.0.1:9999 to view the peer’s file list and download files as needed:

     gonc -p2p <passphrase> -httplocal-port 9999
    

Secure Encrypted P2P Communication

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

Transmission Speed Test

P2P Tunnel and Socks5 Proxy

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: