This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/julienschmidt/httprouter" | |
"log" | |
"net/http" | |
) | |
// handler is a basic HTTP handler that prints hello world. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/julienschmidt/httprouter" | |
"log" | |
"net/http" | |
"net/http/pprof" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/julienschmidt/httprouter" | |
"log" | |
"net/http" | |
"net/http/pprof" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net" | |
"time" | |
) | |
func main() { | |
// Create a listener |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net" | |
"time" | |
) | |
func main() { | |
// Create a listener |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net" | |
) | |
func main() { | |
// Open a TCP Session to Server | |
c, err := net.Dial("tcp", "localhost:9000") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run main.go | |
2021/09/05 11:17:12 TCP Session Open | |
2021/09/05 11:17:27 Error reading TCP Session: read tcp [::1]:9000->[::1]:50770: use of closed network connection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run client.go | |
2021/09/05 11:17:12 TCP Session Open | |
2021/09/05 11:17:27 Error from TCP Session: EOF | |
exit status 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tcpdump -n -vvv -i lo0 port 9000 | |
tcpdump: listening on lo0, link-type NULL (BSD loopback), capture size 262144 bytes | |
11:28:39.808360 IP6 (flowlabel 0x90100, hlim 64, next-header TCP (6) payload length: 44) ::1.50796 > ::1.9000: Flags [S], cksum 0x0034 (incorrect -> 0x8d95), seq 1062602566, win 65535, options [mss 16324,nop,wscale 6,nop,nop,TS val 316484679 ecr 0,sackOK,eol], length 0 | |
11:28:39.808429 IP6 (flowlabel 0x30a00, hlim 64, next-header TCP (6) payload length: 44) ::1.9000 > ::1.50796: Flags [S.], cksum 0x0034 (incorrect -> 0x9e6d), seq 3264678097, ack 1062602567, win 65535, options [mss 16324,nop,wscale 6,nop,nop,TS val 3908319929 ecr 316484679,sackOK,eol], length 0 | |
11:28:39.808445 IP6 (flowlabel 0x90100, hlim 64, next-header TCP (6) payload length: 32) ::1.50796 > ::1.9000: Flags [.], cksum 0x0028 (incorrect -> 0xff6a), seq 1, ack 1, win 6371, options [nop,nop,TS val 316484679 ecr 3908319929], length 0 | |
11:28:39.808457 IP6 (flowlabel 0x30a00, hlim 64, next-header TCP (6) payload length: 32) ::1.9000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14:02:53.050249 IP6 (flowlabel 0xc0d00, hlim 64, next-header TCP (6) payload length: 44) ::1.51212 > ::1.9000: Flags [S], cksum 0x0034 (incorrect -> 0x892f), seq 1824373810, win 65535, options [mss 16324,nop,wscale 6,nop,nop,TS val 4087507955 ecr 0,sackOK,eol], length 0 | |
14:02:53.050421 IP6 (flowlabel 0x90900, hlim 64, next-header TCP (6) payload length: 44) ::1.9000 > ::1.51212: Flags [S.], cksum 0x0034 (incorrect -> 0x128e), seq 924074817, ack 1824373811, win 65535, options [mss 16324,nop,wscale 6,nop,nop,TS val 3688308835 ecr 4087507955,sackOK,eol], length 0 | |
14:02:53.050495 IP6 (flowlabel 0xc0d00, hlim 64, next-header TCP (6) payload length: 32) ::1.51212 > ::1.9000: Flags [.], cksum 0x0028 (incorrect -> 0x738b), seq 1, ack 1, win 6371, options [nop,nop,TS val 4087507955 ecr 3688308835], length 0 | |
14:02:53.050541 IP6 (flowlabel 0x90900, hlim 64, next-header TCP (6) payload length: 32) ::1.9000 > ::1.51212: Flags [.], cksum 0x0028 (incorrect -> 0x738b), seq 1, ack 1, win 6371, options [nop,nop,TS val 36883088 |