Hi all
Here is my problem
I creating SSH tunnel with this library
Tunnel works fine, if i enter url in firefox like :
http://localhost:10000/somefile.js
It is always returned.
But if i request it from the console aplication
after first reqeust in ouput appear
SshNet.Logging Verbose: 1 : SendMessage to server 'ChannelDataMessage': 'SSH_MSG_CHANNEL_DATA : #0'.
SshNet.Logging Verbose: 1 : ReceiveMessage from server: 'ChannelDataMessage': 'SSH_MSG_CHANNEL_DATA : #0'.
SshNet.Logging Verbose: 1 : ReceiveMessage from server: 'ChannelEofMessage': 'SSH_MSG_CHANNEL_EOF : #0'.
SshNet.Logging Verbose: 1 : SendMessage to server 'ChannelEofMessage': 'SSH_MSG_CHANNEL_EOF : #0'.
SshNet.Logging Verbose: 1 : SendMessage to server 'ChannelCloseMessage': 'SSH_MSG_CHANNEL_CLOSE : #0'.
SshNet.Logging Verbose: 1 : ReceiveMessage from server: 'ChannelCloseMessage': 'SSH_MSG_CHANNEL_CLOSE : #0'.
and after 'SSH_MSG_CHANNEL_EOF : #0'.
the code stucks here and then he time out
I tryed to checked it with fiddler so i made everything like in firefox but it still doesnt work
When i create this tunnel by putty console app works.
Thanks for any help or suggestion . Miko
Here is my problem
I creating SSH tunnel with this library
Tunnel works fine, if i enter url in firefox like :
http://localhost:10000/somefile.js
It is always returned.
But if i request it from the console aplication
after first reqeust in ouput appear
SshNet.Logging Verbose: 1 : SendMessage to server 'ChannelDataMessage': 'SSH_MSG_CHANNEL_DATA : #0'.
SshNet.Logging Verbose: 1 : ReceiveMessage from server: 'ChannelDataMessage': 'SSH_MSG_CHANNEL_DATA : #0'.
SshNet.Logging Verbose: 1 : ReceiveMessage from server: 'ChannelEofMessage': 'SSH_MSG_CHANNEL_EOF : #0'.
SshNet.Logging Verbose: 1 : SendMessage to server 'ChannelEofMessage': 'SSH_MSG_CHANNEL_EOF : #0'.
SshNet.Logging Verbose: 1 : SendMessage to server 'ChannelCloseMessage': 'SSH_MSG_CHANNEL_CLOSE : #0'.
SshNet.Logging Verbose: 1 : ReceiveMessage from server: 'ChannelCloseMessage': 'SSH_MSG_CHANNEL_CLOSE : #0'.
and after 'SSH_MSG_CHANNEL_EOF : #0'.
the code stucks here and then he time out
response = request.GetResponse();
here is my complete code:
connectionInfo = new PrivateKeyConnectionInfo(domain, name, new PrivateKeyFile(File.OpenRead(keyPath), pass));
using (client = new SshClient(connectionInfo)) {
client.ErrorOccurred += client_ErrorOccurred;
client.Connect();
port = new ForwardedPortLocal(boundHost, boundPort, remoteHost, remotePort);
client.AddForwardedPort(port);
port.Exception += port_Exception;
port.Start();
SendRequest();
Thread.Sleep(2000);
SendRequest();
// Request Call
void SendRequest(){
string url = "http://localhost:10000/somefile.js";
WebResponse response = null;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/json";
request.UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0";
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
request.KeepAlive = true;
request.Timeout = 15000;
// Here its stacked
response = request.GetResponse();
MemoryStream stream = new MemoryStream();
response.GetResponseStream().CopyTo(stream);
stream.Position = 0;
StreamReader reader = new StreamReader(stream);
string bssResponse = reader.ReadToEnd();
Console.WriteLine(bssResponse.Substring(0, 20));
So where could be difference etween call from firefox and from console app ? I tryed to checked it with fiddler so i made everything like in firefox but it still doesnt work
When i create this tunnel by putty console app works.
Thanks for any help or suggestion . Miko