diff --git a/.gitignore b/.gitignore index a09c56d..063bd18 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /.idea +works/core/test/go.mod +works/core/test/go.sum diff --git a/works/patch/adapter/inbound.go.patch b/works/patch/adapter/inbound.go.patch new file mode 100644 index 0000000..f928617 --- /dev/null +++ b/works/patch/adapter/inbound.go.patch @@ -0,0 +1,26 @@ +--- a/adapter/inbound.go ++++ b/adapter/inbound.go +@@ -79,14 +79,15 @@ + FallbackNetworkType []C.InterfaceType + FallbackDelay time.Duration + +- DestinationAddresses []netip.Addr +- SourceGeoIPCode string +- GeoIPCode string +- ProcessInfo *ConnectionOwner +- SourceMACAddress net.HardwareAddr +- SourceHostname string +- QueryType uint16 +- FakeIP bool ++ DestinationAddresses []netip.Addr ++ IgnoreDestinationAddresses bool ++ SourceGeoIPCode string ++ GeoIPCode string ++ ProcessInfo *ConnectionOwner ++ SourceMACAddress net.HardwareAddr ++ SourceHostname string ++ QueryType uint16 ++ FakeIP bool + + // rule cache + diff --git a/works/patch/protocol/mysql/inbound.go.patch b/works/patch/protocol/mysql/inbound.go.patch index f162252..592324e 100644 --- a/works/patch/protocol/mysql/inbound.go.patch +++ b/works/patch/protocol/mysql/inbound.go.patch @@ -75,7 +75,7 @@ + + // Create a go-mysql server with our TLS config + inbound.mysqlServer = server.NewServer( -+ "8.0.12", ++ "9.7.0", + gmysql.DEFAULT_COLLATION_ID, + gmysql.AUTH_NATIVE_PASSWORD, + nil, diff --git a/works/patch/route/conn.go.patch b/works/patch/route/conn.go.patch new file mode 100644 index 0000000..50b6426 --- /dev/null +++ b/works/patch/route/conn.go.patch @@ -0,0 +1,11 @@ +--- a/route/conn.go ++++ b/route/conn.go +@@ -96,7 +96,7 @@ + remoteConn net.Conn + err error + ) +- if len(metadata.DestinationAddresses) > 0 || metadata.Destination.IsIP() { ++ if !metadata.IgnoreDestinationAddresses && (len(metadata.DestinationAddresses) > 0 || metadata.Destination.IsIP()) { + remoteConn, err = dialer.DialSerialNetwork(ctx, this, N.NetworkTCP, metadata.Destination, metadata.DestinationAddresses, metadata.NetworkStrategy, metadata.NetworkType, metadata.FallbackNetworkType, metadata.FallbackDelay) + } else { + remoteConn, err = this.DialContext(ctx, N.NetworkTCP, metadata.Destination)