1

I am currently building an web app which also utilizes websockets. (Rails for webserver and Nodejs for socket.io)

I have structured my application to use subdomains to separate between connection to the Nodejs server and the Rails webserver. I have "socket.mysite.com" redirected to the Node server and everything else to the webserver.

I am able to test this functionality on localhost. I simply modified my /etc/hosts to include the following:

127.0.0.1 socket.mysite.com 127.0.0.1 mysite.com I know that on production I simply have to generate a CNAME record for socket.mysite.com and this will also work on my users' computers.

However, I am accustomed to testing my application by passing an IP address around. My team typically set up the server on our own machines and do development. When we want to test our individual servers, we just pass around an IP like "http://123.45.123.45".

With the new subdomain hack, this is no longer possible without modifying each of my tester's /etc/hosts. I honestly don't expect my testers to modify their /etc/hosts on the spot. What I can do is have each member of my team have their own domain and create the appropriate CNAME records for each individual team member.

Is there an easier way to allow me to run my app on an IP and just pass that IP around?

1 Answer 1

1

The teams I have worked with have always done this with DNS. Either an actual, purchased domain ( something like companynamedev.com ) or a non-standard tld on our own internal DNS server ( something like companyname.dev ) or a subdomain ( something like dev.companyname.com )

In each case, setting up a wildcard for each developer that pointed to his or her own machine would solve your problem. You wouldn't even need to bother passing around IP addresses any more.

2
  • This is a question and answer along my line right now - I'm interested by how the latter part of your answer works? Each developer has a wildcard? How do they USE that wildcard?
    – waxical
    Feb 4, 2013 at 10:11
  • Your DNS entry would be *.waxical.companydev.com and it would resolve to the internal IP address of your computer (or VM). Each developer would have an equivalent. You would use www.waxical.companydev.com in your browser to see your dev environment and your dev code would use socket.waxical.companydev.com to access the websocket. If you want to see your colleague's version of the code, just change the domain in your browser to use his name instead of yours.
    – Ladadadada
    Feb 4, 2013 at 11:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .