[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] httpd: how to redirect to a new address
From: |
address@hidden |
Subject: |
Re: [lwip-users] httpd: how to redirect to a new address |
Date: |
Tue, 20 Feb 2018 09:00:24 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 19.02.2018 23:18, Jan Menzel wrote:
Hi all!
In our application we wont to allow the user to change the ip address
of the server using a webpage. I wonder what would be the best way of
doing that.
At present we use a very basic webserver that servers a different page
(with HTTP status code 301) if the parameters update the ip address.
After sending out the last byte we change the ip address, so the server
is immediately listening on the new address.
That's not really correct. The tcp connection lasts at least a little
longer as the http server knows. I think you'll get some kind of tcp
connection errors when doing it that way. It might work, but it's better
to wait a little longer and implement a delay in the browser, as
Giuseppe already mentioned.
With lwip we can either use LWIP_HTTPD_CGI_SSI with a single parameter
handler but how to server different status codes? And, when is the
correct time of changing the ip address? Or we could use LWIP_HTTPD_CGI
which read kind of deprecated in the documentation.
Is there a recommended procedure how lwip can server is purpose?
Changing the headers (or adding header fields) is currently not
supported. This is something on the list (at least a minimum support to
enable user login sessions), but it's not there, yet.
However, you can implement this by using custom files. When the returned
file has FS_FILE_FLAGS_HEADER_INCLUDED set in its flags, httpd assumes
file->data includes both the file data *and* all http headers. You are
then free to send all headers you whish.
This can be combined with any CGI or SSI support.
Simon
Jan
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users