Redirect IE from SSL Stream

Add-in Express™ Support Service
That's what is more important than anything else

Redirect IE from SSL Stream
 
Irfan Basha




Posts: 9
Joined: 2011-06-03
Hi,

I am using sslstream to redirect the traffic to our server and check if the user has logged in.
The server returns with status "HTTP/1.1 200 OK" or "HTTP/1.1 302 FOUND".

now I want to redirect the brower appropriately. Can anyone let me know how I can do it?
Can I use navigate or navigate2 function with the response "HTTP/1.1 302 FOUND" ?

Thanks
Posted 20 Jun, 2011 06:11:19 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Irfan,

All available parameters of the Navigate2 method are described here:
http://msdn.microsoft.com/en-us/library/aa752094(v=vs.85).aspx
To process all user's requests you can use the BeforeNavigate2 and DocumentComplete events.
Posted 20 Jun, 2011 09:56:54 Top
Irfan Basha




Posts: 9
Joined: 2011-06-03
Hi Sergey Grischenko,

Thanks for the reply.

Can you let me know how I can do the following:

When ever the user types any url and presses enter, I want to get the request in the form
(For example if the user types www,google.com in url and presses enter)
"GET google.com HTTP/1.1\r\n
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1\r\n
Proxy-Connection: keep-alive\r\n
Host: www.google.com\r\n"

I have written the BeforeNavigate2 method which is triggered every time the request is submitted. But am not able to get the request in the above form.


Thanks
Irfan
Posted 24 Jun, 2011 09:48:37 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Irfan.

Could you please describe your task in more details? The fact is that IE doesn't provide any Reguest and Responce objects in contrast to ASP.NET. Probably you will have to search for another approach.
Posted 24 Jun, 2011 10:14:36 Top
Irfan Basha




Posts: 9
Joined: 2011-06-03
Hi Sergey Grischenko,

My requirement is as follows:

When the user enters a URL (Say www.google.com) and presses enter, I have to first catch the url and perform some operations on it like send it to our server and get the reply back from our server. But I have to send the data to our server in the form ""GET google.com HTTP/1.1\r\n
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1\r\n
Proxy-Connection: keep-alive\r\n
Host: www.google.com\r\n" "

our server then does some internal operations and sends the reply in the form
"HTTP/1.1 OK Found" or "HTTP/1.1 302 Found" etc...

Now after I get this response from our server, I have to display it on IE. i.e if the response is "HTTP/1.1 OK Found" then I have to load the google.com on IE.

Is this possible ?

Thanks
Irfan
Posted 27 Jun, 2011 03:31:00 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Irfan.

You need to use the HttpWebRequest and HttpWebResponse classes of the .NET Framework in order to communicate with the server.
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(v=vs.71).aspx
http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.aspx
Posted 27 Jun, 2011 04:40:33 Top
Irfan Basha




Posts: 9
Joined: 2011-06-03
Thanks for the reply...

I'll try using it. but isn't there any event (or event arg) from which I can get the http request ?
Posted 27 Jun, 2011 04:47:25 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Irfan.

As far as I understand your idea, you need to use these components in the BeforeNavigate2 event handler.
Posted 27 Jun, 2011 04:53:05 Top
Irfan Basha




Posts: 9
Joined: 2011-06-03
ok.

Thank you very much for your help.
Posted 27 Jun, 2011 04:54:31 Top
Irfan Basha




Posts: 9
Joined: 2011-06-03
Hi Sergey Grischenko,

I know I can get the Http request headers by using HttpWebRequest and HttpWebResponse methods. But is there any way I can get it using the AddInExpress events ?

Thanks
Irfan
Posted 13 Jul, 2011 07:54:14 Top