问题描述:

I'd like to redirect traffic that normally goes to a SQL Server to go to a local instance of SQL that may run on a different port. Usually you would just redirect the traffic from db.example.com to 127.0.0.1, but in this instance I have two servers my program is connecting to. For this example I'll call them

db.foo.com and db.bar.com. They both need to connect to a different SQL Server instance...

Is there a way to redirect traffic that goes to a specific host and port (without modifying code) to another host and a different port? I have not been able to find any solutions yet. Maybe I can get some help here.

Additional details:

I use Visual Studio to work with the code. I'd only need this redirect when developing locally. I want to do this because certain SQL calls to external servers force me to wait 5 minutes when all I need to do is test changes to my CODE, not the queries. If I can establish a proxy like that redirects this traffic to a local server/port, I can then use a program that listens on the specified server/port to act as a cached proxy between my proxy enabling this sort of proxy set up it'll free me up to write a proxy SQL server that runs on the specified local host and port that can cache SQL data sent back and forth between the local and external server.

相关阅读:
Top