lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] httpd: how to redirect to a new address


From: Giuseppe Modugno
Subject: Re: [lwip-users] httpd: how to redirect to a new address
Date: Tue, 20 Feb 2018 08:10:21 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Consider that the browser can't continue the communication with the server if you change the server IP address. So I implemented the IP address change of the web server in the following way.

The client requests a URI with a query string with the new IP configuration. httpd calls a CGI handler/callback that saves the new IP configuration on the non-volatile memory and reboot itself. The Javascript code running in the browser waits for some seconds (with a progress bar) after sending the new IP configuration, then redirect to the home page again, but using the new IP address.

In this way I avoided the change of IP address during runtime.

Il 19/02/2018 23:18, Jan Menzel ha scritto:
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.
        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?

        Jan

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]