How to implement TCP dialing using gvisor's gonet package?

55 Views Asked by At

right now i have this implementation of TCP dialing

(&net.Dialer{Timeout: conn.TimeOut}).DialContext(s.ctx, "tcp", host)

which uses net golang library


i need to know how to create a custom network stack using the capabilities of gvisor and then use it to make TCP connections with gonet.DialTCP function from gonet


i tried running this sample script tun_tcp_connect that is in gvisor's github repository. i tried to connect to google DNS server with created network stack and expected to receive packets back but there were only outgoing packets that were printed to stdout

0

There are 0 best solutions below