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?


lwip-users mailing list

lwip-users mailing list

Reply via email to