example

command
v0.84.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

How to run

This will only work on Linux

  1. Run netcat listening on the UDP port 51820. This is going to be our external process:
nc -kluvw 1 51820
  1. Build and run the example Go code:
 go build -o sharedsock && sudo ./sharedsock
  1. Test the logic by sending a STUN binding request
STUN_PACKET="000100002112A4425454" 
echo -n $STUN_PACKET | xxd -r -p | nc -u -w 1 localhost 51820
  1. You should see a similar output of the Go program. Note that you'll see some binary output in the netcat server too. This is due to the fact that kernel copies packets to both processes.
 read a STUN packet of size 18 from ...
  1. Send a non-STUN packet
echo -n 'hello' |  nc -u -w 1 localhost 51820
  1. The Go program won't print anything.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL