title: How to assign a domain name to node.js server?
body: <p>I have a node.js server listening to port 4000, the URL to access the service is something like this:</p>
  <blockquote>
  <p>http://42.12.251.830:4000</p>
  </blockquote>
  <p>I bought a domain name</p>
  <blockquote>
  <p>www.mydomain.com</p>
  </blockquote>
  <p>How can I assign it to my server? First I used forwarding, but then I could not use location.hash anymore to add a chat channel to the URL. Then I used something like Header-Redirect. Now the service is reachable under mydomain.com , but not under <a href="http://www.mydomain.com" rel="nofollow noreferrer">www.mydomain.com</a>. Moreover the domain name is not shown in the browser window. For my chat channel I need something like this:</p>
  <blockquote>
  <p>www.mydomain.com/#238husd4</p>
  </blockquote>