-->
Page 1 of 1

how to use specific port while creating server object ?

PostPosted: Sat Nov 25, 2017 4:03 am
by seaurchin
I am creating web server of NodeMCU using

(at global level)
Code: Select allESP8266WebServer server (80);


but I want to create server of port other than 80 . i.e. 88 instead of 80 since manually assigned IP is 192.168.1.88

and it is easy to rememeber.
in the setup function I have below
Code: Select all 
  // config static IP
  IPAddress ip(192, 168, 1, 88);
  IPAddress gateway(192, 168, 1, 1);
  IPAddress subnet(255, 255, 255, 0);
  IPAddress dns(192, 168, 1, 1);
  WiFi.config(ip, dns, gateway, subnet);
  Serial.print("Mac Address:: ");
  Serial.println(WiFi.macAddress());
  // Connect to WiFi network
  WiFi.begin(ssid, password);


please help me on this ?