0

I wonder how I can add to Cloudflare subdomain to a specific port that can work in the browser.

I open a socket using socket.io on port 9090 and have an index.html file

server.listen(9090);

if I go to http://myip:9090/index.html it working but I don't want the users to see the port in the address only http://myip/index.html so I set in Cloudflare A record but its now just a domain with port http://example.com:9090/index.html and I want http://example.com/index.html

I can't use the 80 or 8080 port (its already in use)

thanks for the help!

Bossa
  • 3
  • 2

1 Answers1

0

Assign a different IP address to you subdomain. Than you can listen on port 80, the only port the browser will hide.

Alternatively, let whatever is occupying port 80, handle the subdomain too, be it as a reverse proxy for your node.js.

Gerard H. Pille
  • 2,569
  • 1
  • 13
  • 11