Mobile app version of vmapp.org
Login or Join
Cugini213

: How can I assign domain name to port number? I have built a socket io project and the server.js listens to a specific port number 2000. Now I have uploaded this project to the server and

@Cugini213

Posted in: #Domains #PortNumber

I have built a socket io project and the server.js listens to a specific port number 2000.

Now I have uploaded this project to the server and I can access the server by entering ipAddress:2000 with ease. I have also purchased a domain and have it attached to the ip address. So now I can visit the server by domainName:8000.

But that is not what I want eventually, I want to visit my server by just entering the ip address or just the domain name.

How can I achieve this?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cugini213

1 Comments

Sorted by latest first Latest Oldest Best

 

@LarsenBagley505

Domain names have nothing to do with port numbers at all. All a domain name does is resolve to an IP address, the port is completely independent of that process. In order to achieve what you are wanting to do you will either need to change the server listening port to port 80 (which is the default HTTP port), port 443 (which is the default HTTPS port), or if changing listening port numbers is not an option you will need to implement some form of redirecting logic which can be a proxy server. As you don't mention the network topology I will add here that some business line routers (especially those that support port forwarding) also support changing the port. Either way it is not as simple as a DNS configuration with your domain name and will in fact need to be done at the network level, either in server configuration, gateway configuration, or with an intermediary system like a proxy server.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme