How to redirect Pocket Internet Explorer to a new URL

  • Thread starter Thread starter Johann Blake
  • Start date Start date
J

Johann Blake

I have an application that intercepts a user clicking on a link in
Pocket Internet Explorer (PIE). This is possible since the web page
the user is viewing is created by my application and each link uses:

http://127.0.0.1:59500/xxx.htm

where xxx is the name of some web page stored locally on the user's
PDA.

When the user clicks on a link, my application acts like a mini web
server and intercepts the request. I then want to redirect the browser
to a local file.

I have access to the underlying stream that gets sent back to PIE so I
can write whatever I want to the browser.

I have tried using HTTP codes such as 301 and 302 along with
additional header information. This doesn't work. PIE continues to
call my web server even after I close the socket that it opened.

Here is what an example of using response codes looks like:

streamWriter.WriteLine("HTTP/1.1 301 Moved Permanently");
streamWriter.WriteLine("Location: " + file);
streamWriter.WriteLine("Connection: close");
streamWriter.WriteLine("Content-Type: text/html");
streamWriter.WriteLine();

I also tried using a META tag such as:

<META HTTP-EQUIV="Refresh" CONTENT="5" URL="xxx.htm">

This doesn't do anything.

Any suggestions?

Thanks
Johann
 
This isn't answering this question, but one thing to be aware of is that
Pocket IE on PPC 2003 has problems contacting http://localhost/ to a real
web server if you're not connected to a network. I can't tell if your app
is really listening on the port below and you're using winsock to go between
PIE and your server, or if you've hacked PIE some way I don't know of to
have PIE send you the request directly without winsock.

Check out
http://groups.google.com/groups?q=P...&selm=#[email protected]&r
for how to workaround the generic http://localhost/ problem.

--
John Spaith
Software Design Engineer, Windows CE
Microsoft Corporation

Check out the new CE Networking Team Blog at http://blogs.msdn.com/cenet/.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2003 Microsoft Corporation. All rights
reserved.
 
I don't use localhost because it is well known that this does not always
work as expected. But using the IP address 127.0.0.1 always works.

I managed to do a redirect using the following...

HTTP/1.1 301 Moved Permanently
Location: file://somefile
Content-Type: text/html

This will only work on a Pocket PC because their are no fixed drives and
the path is always relative. You cannot use this however on a normal
desktop because it will fail if you use an absolute path with a drive.
 
Back
Top