> I have HTTP server application. User has possibility to change listening
> port. Is it possible to redirect a browser to another port ?
>

if the browser is recent enough, when connecting,
you should have in the request a header named "Host: " followed by the hostname 
(or ip address) the browser connects to.

i would suggest to store it, at the connection, and when you're changing
the listening port, to do :

Doc := '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">'#13#10 +
          '<html><head><title>Linker gateway</title>'#13#10 +
          '<meta http-equiv="Refresh" 
content="2;url=http://'+(*)gstSavedHost+':'+gstNewPort+'/index.html">'#13#10 +
          '</head><body><br><br><br><div align="center">'#13#10 +
          '<h1>Please wait a moment, server is restarting</h1>'#13#10 +
          '</div></body></html>';

(*) i'm not sure if the Host header contains the 'http://' prefix or not...

if the browser does not send this Header, then i suggest you to store the public
hostname of your http server into a config file (variable) and to use it
when you need to transmit your address back to a client browser.

HTH,

Guillaume MAISON
-----
Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
TÚl : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to