mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
comments
This commit is contained in:
parent
7e5e080488
commit
95ed5a5ff8
@ -15,8 +15,12 @@ type IPOption struct {
|
|||||||
IPv6Enable bool
|
IPv6Enable bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Client is the interface for DNS client.
|
||||||
type Client interface {
|
type Client interface {
|
||||||
|
// Name of the Client.
|
||||||
Name() string
|
Name() string
|
||||||
|
|
||||||
|
// QueryIP sends IP queries to its configured server.
|
||||||
QueryIP(ctx context.Context, domain string, option IPOption) ([]net.IP, error)
|
QueryIP(ctx context.Context, domain string, option IPOption) ([]net.IP, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,10 +25,12 @@ func NewAesStreamMethod(key []byte, iv []byte, f func(cipher.Block, []byte) ciph
|
|||||||
return f(aesBlock, iv)
|
return f(aesBlock, iv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewAesCTRStream creates a stream cipher based on AES-CTR.
|
||||||
func NewAesCTRStream(key []byte, iv []byte) cipher.Stream {
|
func NewAesCTRStream(key []byte, iv []byte) cipher.Stream {
|
||||||
return NewAesStreamMethod(key, iv, cipher.NewCTR)
|
return NewAesStreamMethod(key, iv, cipher.NewCTR)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewAesGcm creates a AEAD cipher based on AES-GCM.
|
||||||
func NewAesGcm(key []byte) cipher.AEAD {
|
func NewAesGcm(key []byte) cipher.AEAD {
|
||||||
block, err := aes.NewCipher(key)
|
block, err := aes.NewCipher(key)
|
||||||
common.Must(err)
|
common.Must(err)
|
||||||
|
@ -47,6 +47,7 @@ func fetchInput(ctx context.Context, input io.Reader, reader PacketReader, conn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DialKCP dials a new KCP connections to the specific destination.
|
||||||
func DialKCP(ctx context.Context, dest net.Destination, streamSettings *internet.MemoryStreamConfig) (internet.Connection, error) {
|
func DialKCP(ctx context.Context, dest net.Destination, streamSettings *internet.MemoryStreamConfig) (internet.Connection, error) {
|
||||||
dest.Network = net.Network_UDP
|
dest.Network = net.Network_UDP
|
||||||
newError("dialing mKCP to ", dest).WriteToLog()
|
newError("dialing mKCP to ", dest).WriteToLog()
|
||||||
|
Loading…
Reference in New Issue
Block a user