Is it possible to redirect the url to another using a web proxy (e.g. violinist)

I am trying to parse a WSDL file that is on another server but has a hard "localhost" throughout the document.

When I remove it, it’s obvious that the program complains about a “connection failure” because nothing works on my machine.

My question is: is it possible to use a web proxy (e.g. a violinist) to redirect these localhost requests to another server so that the WSDL links are completed?

: - /

thanks

ps I could always fix the remote "wsdl", but the guy on charge will be here until next week, and I would like to start working today.

+4
source share
4 answers

You can use Fiddler as a proxy server from your computer and then rewrite WSDL to change localhost to the correct machine name.

FiddlerScript CookBook contains an example of how to write this kind of script. Go to this page and find "Delete all DIV tags (and the contents inside the DIV tag)." Just change the regular expression to match localhost and set the replacement to the name of the machine you want to use.

+5
source

If you have SSH access to the machine, you can use SSH port forwarding to do this. I assume you are using Windows (based on the C # tag), so you can use Putty as described here: Using port forwarding with PuTTY . Just follow these instructions to redirect the desired port to "localhost" to the server that serves WSDL.

Alternatively, if you are using an nix or Mac based computer, use SSH with the following command:

ssh -L PORTYOUWILLUSE:localhost:PORTONSERVER username@serverhostname 

For example, if the WSDL was sent to port 80, you could do

 ssh -L 80:localhost:80 username@server 

As soon as you log in (using any method), any requests to localhost on port 80 will be redirected to the server.

+1
source

If you want to change it within a few minutes while analyzing the WSDL, you can change the HOST file and point "localhost" to the remote IP address. The hosts file is located in "C: \ Windows \ System32 \ drivers \ etc" in Windows Vista / XP.

0
source

There are several ways to achieve this, none of them are particularly reliable as long-term solutions, but you say that you just need something temporary until the developer returns.

If everything matches the domain (if your remote URL does not match the local host), you can edit your localhost entry in the hosts file.

In system32 \ drivers \ etc, copy the "hosts" file to your desktop. Open in notepad and change this line:

 127.0.0.1 localhost 

Change the IP address (127.0.0.1) to the remote domain. Then copy the hosts file back to the directory etc. (Note: it is not possible to edit this file directly as Administrator or otherwise).

If you have multiple domains in a remote web service, in IIS you need to change the website to serve requests to "localhost", this may seem a little strange, but it will work because your machine will make requests to the server IP address, but specify the request domain as "localhost". Right-click the website in IIS and select properties, and then add the "localhost" domain to the list of HTTP header values ​​supported by this website. You can ignore all this if your website in IIS will serve content if you access it through an IP address. If this single IP address is shared between several websites (this is usually the case), you will get a "Bad hostname" error from IIS as it tries to search for "localhost" and cannot find which website should send the request to .

Another possibility is to use a personal proxy server called Proxomitron . It is a bit old and is no longer under development, but it is very easy to set up and very durable.

After you installed it, open it and click "Config" - change the port where it listens to 80. Then you need to create a redirection rule (this is not a redirect, but rather a rewrite of the URL), you will need to quickly read the docs to understand how to add your own call forwarding, but there are many samples that come with the application. The rule you are looking for is RDIR:

$ RDIR () More discreetly and redirects the connection to Proxomitron without specifying your browser. This is useful when you want your browser to think that this is happening in one place, when in fact it is happening somewhere else.

0
source

Source: https://habr.com/ru/post/1286159/


All Articles