Change HTTP Port from 80 to xxx

Hello all,

I can’t figure out how to change the async webserver port from port 80 to another port.

I found the global and set it to something different and it crashes. I found all instances of server(80) and replaced with a different port and it still crashes or just loops.

I’m at a loss. Amy thoughts on this?

Thank you!!

OK. Finally figured out how to hard code a different port.

However, in AP mode, it does not automatically connect like usual. I had to connect to the AP using:
4.3.2.1:[port]/setting/wifi where [port] = port number specified.

Seems to me that there is an issue when “Captive portal” shows up in the debug log. Will investigate further.

—DEBUG INFO—
Runtime: 80028
Unix time: 80
Free heap: 32328
Wifi state: 0
State time: 10000
NTP last sync: 999000000
Client IP: 255.255.255.255
Loops/sec: 4102
Captive portal

I set my wifi settings described above, then accessed it using local IP:[port]

Connected! IP address: 10.0.0.51
Init STA interfaces
mDNS started
Access point disabled.
FileRead: /index.htm
Not-Found HTTP call:
URI: /presets.json
FileRead: /presets.json

Hi!
Glad you got it to work in some capacity.
Captive portal might not work with some clients if you are using non-standard ports for HTTP traffic. Maybe changing line 28 of wled_server.cpp could help: response->addHeader(F("Location"), F("http://4.3.2.1:[port]"));

Basically add your port after the IP inside the string :slight_smile:
Not sure it works but might be worth a shot!