A netcat-like tool with proxy support, written in Go.
- Direct TCP connections - Connect directly to any TCP port
- HTTP/HTTPS Proxy - Connect through HTTP CONNECT proxies with authentication
- SOCKS5 Proxy - Support for SOCKS5 proxies with authentication (using golang.org/x/net/proxy)
- TLS/SSL Support - Direct TLS connections or TLS over proxy
- Port Scanning - Zero I/O mode for port scanning
- Listen Mode - Act as a server and accept connections
- Verbose Output - Detailed connection information
# Install from source
go install github.com/crimson-and-clover/go-connect/cmd/go-connect@latest
# Or clone and build locally
git clone https://github.com/crimson-and-clover/go-connect.git
cd go-connect
go install ./cmd/go-connect
# Or use make
make build
make install# Simple connection (like nc host port)
go-connect example.com 80
go-connect -v example.com 443# HTTP CONNECT proxy
go-connect -x http://proxy.company.com:8080 target.example.com 443
# With authentication
go-connect -x http://user:pass@proxy.company.com:8080 target.example.com 443# SOCKS5
go-connect -x socks5://proxy.example.com:1080 target.com 80
# SOCKS5 with authentication
go-connect -x socks5://user:pass@proxy.example.com:1080 target.com 80go-connect -x https://proxy.company.com:443 target.example.com 443# Direct TLS connection
go-connect -T -v api.example.com 443
# TLS through proxy
go-connect -x socks5://proxy:1080 -T api.example.com 443
# Skip certificate verification
go-connect -T -k self-signed.example.com 443# Scan single port
go-connect -z -v target.example.com 443
# Scan port range
go-connect -z -v -w 1s target.example.com 1-1000
# Scan multiple discrete and range ports (comma or space separated)
go-connect -z -v -w 500ms target.example.com 22,80,443,8000-8010,3306
go-connect -z -v -w 500ms target.example.com 22 80 443 8080# Listen on port 8080
go-connect -l -p 8080
# With verbose output
go-connect -l -p 8080 -v
### Unix Domain Socket
```bash
# Connect to local Unix Domain Socket (e.g. Docker daemon)
echo -e "GET /v1.41/containers/json HTTP/1.0\r\n\r\n" | go-connect -U /var/run/docker.sock
# Listen on a Unix Domain Socket
go-connect -l -U /tmp/test.sock# Send UDP datagram / connect
echo "hello udp" | go-connect -u 127.0.0.1 5353
# Listen on UDP port 5353
go-connect -l -u -p 5353 -v| Option | Description |
|---|---|
-x URL |
Proxy URL (http://, https://, socks5://) |
-T |
Enable TLS |
-k |
Skip TLS certificate verification |
-t duration |
Connection timeout (default: 30s) |
-v |
Verbose output |
-u |
Use UDP mode |
-U |
Use Unix Domain Socket |
-z |
Zero I/O mode (port scanning) |
-l |
Listen mode |
-p port |
Port to listen on (with -l) |
-w duration |
Timeout alias (nc compatible) |
-X |
Hex dump incoming and outgoing traffic |
-V |
Show version |
ssh -o ProxyCommand="go-connect -x http://proxy:8080 %h %p" user@remotehostexport GIT_SSH_COMMAND="ssh -o ProxyCommand='go-connect -x socks5://127.0.0.1:1080 %h %p'"
git clone git@github.com:user/repo.gitecho -e "GET / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n" | go-connect -T example.com 443MIT License