mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 17:35:40 +08:00
15 lines
267 B
Go
15 lines
267 B
Go
![]() |
package proxy
|
||
|
|
||
|
import (
|
||
|
"net"
|
||
|
"syscall"
|
||
|
)
|
||
|
|
||
|
func bind(dialer *net.Dialer, iface *net.Interface) {
|
||
|
dialer.Control = func(network, address string, c syscall.RawConn) error {
|
||
|
return c.Control(func(fd uintptr) {
|
||
|
syscall.BindToDevice(int(fd), iface.Name)
|
||
|
})
|
||
|
}
|
||
|
}
|