@@ -5,12 +5,16 @@ import (
55 "syscall"
66)
77
8+ const (
9+ IPV6_TCLASS = 39 // Not defined in Go's syscall package for Windows
10+ )
11+
812func (proxy * Proxy ) udpListenerConfig () (* net.ListenConfig , error ) {
913 return & net.ListenConfig {
1014 Control : func (network , address string , c syscall.RawConn ) error {
1115 _ = c .Control (func (fd uintptr ) {
1216 _ = syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IP , syscall .IP_TOS , 0x70 )
13- _ = syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IPV6 , syscall . IPV6_TCLASS , 0x70 )
17+ _ = syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IPV6 , IPV6_TCLASS , 0x70 )
1418 _ = syscall .SetsockoptInt (syscall .Handle (fd ), syscall .SOL_SOCKET , syscall .SO_RCVBUF , 4096 )
1519 _ = syscall .SetsockoptInt (syscall .Handle (fd ), syscall .SOL_SOCKET , syscall .SO_SNDBUF , 4096 )
1620 })
@@ -24,7 +28,7 @@ func (proxy *Proxy) tcpListenerConfig() (*net.ListenConfig, error) {
2428 Control : func (network , address string , c syscall.RawConn ) error {
2529 _ = c .Control (func (fd uintptr ) {
2630 _ = syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IP , syscall .IP_TOS , 0x70 )
27- _ = syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IPV6 , syscall . IPV6_TCLASS , 0x70 )
31+ _ = syscall .SetsockoptInt (syscall .Handle (fd ), syscall .IPPROTO_IPV6 , IPV6_TCLASS , 0x70 )
2832 })
2933 return nil
3034 },
0 commit comments