http_server, server_port overide settings

mikemoy
Posts: 626
Joined: Fri Jan 12, 2018 9:10 pm

http_server, server_port overide settings

Postby mikemoy » Wed Jan 16, 2019 5:09 am

Has anyone tried to change the server_port default vale of 80 to something else, and have it work?

I have the following and if i leave config.server_port=80 it works just fine, however if i change config.server_port=8080 it wont work.

httpd_config_t config = HTTPD_DEFAULT_CONFIG();
// Lets change this from port 80(default) to 8080
config.server_port = 8080;

mikemoy
Posts: 626
Joined: Fri Jan 12, 2018 9:10 pm

Re: http_server, server_port overide settings

Postby mikemoy » Thu Jan 24, 2019 12:39 pm

No one has no idea why changing server ports does not work?

ESP_Anurag
Posts: 19
Joined: Fri Aug 31, 2018 5:37 am

Re: http_server, server_port overide settings

Postby ESP_Anurag » Fri Mar 01, 2019 6:14 am

Sorry about the delayed reply.

The port configuration works and can be tested using examples/protocols/http_server/advanced_tests. Here's how the configuration is set:

Code: Select all

    httpd_handle_t hd;
    httpd_config_t config = HTTPD_DEFAULT_CONFIG();
    config.server_port = 1234;
    ESP_ERROR_CHECK(httpd_start(&hd, &config) );
The server configuration structure needs to be passed to httpd_start() for this to work (as shown above). Could you please show us the part of your code where this configuration is being set?

Who is online

Users browsing this forum: forrest, Google [Bot] and 86 guests