Basically, I have an ESP8266 NodeMcu that connects to a wifi network. An RFID reader is connected and whenever the RFID card is tapped on the reader, an instance of SocketIoClient
from ArduinoWebSockets
will send an event on the server. I manage to make it work in Node.js Socket.io server deployed in Heroku, but I cannot connect it to my server deployed to Fly.io.
This is my code in my .ino file.
const char *server = "sbca-server.fly.dev";
inside the setup
webSocket.begin(server, 8080);
I am thinking that the problem here is the port of the server in fly.io.
because it works in Heroku using port 80
but did not work in fly.io.
const char *server = "sbca-server.herokuapp.com";
setup(){
webSocket.begin(server, 80);
}
What is the correct port to use?