mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-15 11:21:04 +01:00
22 lines
432 B
Go
22 lines
432 B
Go
|
package net
|
||
|
|
||
|
import (
|
||
|
"net"
|
||
|
)
|
||
|
|
||
|
// Dialer extends the standard net.Dialer with the ability to execute hooks before
|
||
|
// and after connections. This can be used to bypass the VPN for connections using this dialer.
|
||
|
type Dialer struct {
|
||
|
*net.Dialer
|
||
|
}
|
||
|
|
||
|
// NewDialer returns a customized net.Dialer with overridden Control method
|
||
|
func NewDialer() *Dialer {
|
||
|
dialer := &Dialer{
|
||
|
Dialer: &net.Dialer{},
|
||
|
}
|
||
|
dialer.init()
|
||
|
|
||
|
return dialer
|
||
|
}
|