kpreisser / TcpTunnel

TcpTunnel allows to tunnel TCP connections through a server (gateway) to a remote machine.
MIT License
25 stars 1 forks source link

Question on forwarding a SQL connection to client #3

Open GengyiQin opened 1 month ago

GengyiQin commented 1 month ago

Hi there! I came across your work and want to try to forward a MS SQL connection on an Azure VM to my local machine using your TCP tunnel. The binding defined on proxy-server side looks like this: <Binding listenPort="1433" targetHost="127.0.0.2" targetPort="11433" /> And while the gateway (a separate VM with ports open, not setup with SSL/TLS) confirmed the the connection from both client and server authenticated, I cannot connect to the server from my local port.

I previously achieved similar things by using Azure Relay and azbridge (with Azure Relay hub acting as the gateway), so I wonder if I have some misunderstanding about your tool/config that this doesn't work. Please let me know what you think or if more info is needed, any help would be greatly appreciated

kpreisser commented 1 month ago

Hi @GengyiQin, thanks for opening this issue!

The config of the proxy-server looks good. Is the MS SQL server on the Azure VM actually listening on an IPv4 address like 0.0.0.0 or 127.0.0.2? (On Windows you can check it with a command like netstat -noa | find ":11433".)

Is the proxy-server instance running on your local machine where you are trying to connect with an SQL client application, and is the proxy-client instance runing on the Azure VM where the SQL Server is running? Can you show the console output from the gateway and from the proxy-server instances?

Thanks!