mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-08-31 08:44:16 -04:00
19 lines
367 B
Go
19 lines
367 B
Go
package internet
|
|
|
|
import "net"
|
|
|
|
var v2AlternativeDialer *V2AlternativeDialerT
|
|
|
|
type V2AlternativeDialerT interface {
|
|
Dial(nw string, ad string) (net.Conn, error)
|
|
}
|
|
|
|
func SubstituteDialer(substituteWith V2AlternativeDialerT) error {
|
|
v2AlternativeDialer = &substituteWith
|
|
return nil
|
|
}
|
|
|
|
func isDefaultDialerSubstituted() bool {
|
|
return (v2AlternativeDialer != nil)
|
|
}
|