mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-15 19:31:06 +01:00
9e8725618e
- dupword checks for duplicate words in the source code - durationcheck checks for two durations multiplied together - forbidigo forbids identifiers - mirror reports wrong mirror patterns of bytes/strings usage - misspell finds commonly misspelled English words in comments - predeclared finds code that shadows one of Go's predeclared identifiers - thelper detects Go test helpers without t.Helper() call and checks the consistency of test helpers |
||
---|---|---|
.. | ||
main.go | ||
README.md |
How to run
This will only work on Linux
- Run netcat listening on the UDP port 51820. This is going to be our external process:
nc -kluvw 1 51820
- Build and run the example Go code:
go build -o sharedsock && sudo ./sharedsock
- 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
- 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 ...
- Send a non-STUN packet
echo -n 'hello' | nc -u -w 1 localhost 51820
- The Go program won't print anything.