Is there a way to set the port in the Host header to a port that is
different from the port in the URI?    I tried setVirtualHost but that sets
the host part only and port is still the port in the URI.

For example:

HttpClient client = new HttpClient();
PostMethod postMethod =  new PostMethod("localhost:8888");
client.getParams().setVirtualHost("my.realhost.com:80");

The above will set the Host header as:
Host: my.realhost.com:8888

How can I set it to Host: my.realhost.com:80 ?

I need to do this because of I need to use ssh port forwarding to access a
server which is only accessible from a certain IP.

Thanks,

Phoebe

Reply via email to