mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-10 19:20:15 +08:00
16 lines
268 B
Go
Executable File
16 lines
268 B
Go
Executable File
package dialer
|
|
|
|
import "net"
|
|
|
|
var _boundInterface *net.Interface
|
|
|
|
// BindToInterface binds dialer to specific interface.
|
|
func BindToInterface(name string) error {
|
|
i, err := net.InterfaceByName(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_boundInterface = i
|
|
return nil
|
|
}
|