开发者

How do I access a WebService through an SSH tunnel?

Got a question. I'm sitting on a closed network, and I need access to a WebService out in the DMZ. The WebService is made available through a non-80 TCP port (let's call it 1234), which is blocked by the firewall of the closed network.

I do, however, have SSH access to a server in the DMZ (let's call that one 'dmzhost'), so I thought the solution would be to simply put up a tunnel like this:

ssh -L 4321:wsIpHere:1234 username@dmzhost

After that, I should be able to access the WS endpoint through the URL http://localhost:4321. No luck. I tried it with my web-browser, and got the message

Cannot bind to address "http://localhost:1234/" No component registered on that endpoint开发者_运维知识库

I think I've missed the point here somewhere. Does anyone have a clue as to what I'm doing wrong?

Thanks!


If wsIpHere is the ip address of the webservice on the dmz that should work. But I believe you want to use localhost:4321 for it to work.

telnet is a good tool to debug here as well.


You indicated that the local port is 4321, but the error message indicates that the local port is 1234.

I recommend using the same port:

ssh -L 1234:wsIphere:1234 username@dmzhost
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜