|
|
@ -1,7 +1,6 @@
|
|
|
|
package kcp
|
|
|
|
package kcp
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"math/rand"
|
|
|
|
"math/rand"
|
|
|
|
"net"
|
|
|
|
"net"
|
|
|
|
|
|
|
|
|
|
|
@ -10,10 +9,6 @@ import (
|
|
|
|
"github.com/v2ray/v2ray-core/transport/internet"
|
|
|
|
"github.com/v2ray/v2ray-core/transport/internet"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
ErrUnknownDestination = errors.New("Destination IP can't be resolved.")
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func DialKCP(src v2net.Address, dest v2net.Destination) (internet.Connection, error) {
|
|
|
|
func DialKCP(src v2net.Address, dest v2net.Destination) (internet.Connection, error) {
|
|
|
|
udpDest := v2net.UDPDestination(dest.Address(), dest.Port())
|
|
|
|
udpDest := v2net.UDPDestination(dest.Address(), dest.Port())
|
|
|
|
log.Info("Dialling KCP to ", udpDest)
|
|
|
|
log.Info("Dialling KCP to ", udpDest)
|
|
|
|