More GServer Goodness
In a previous posting, I demonstrated how to create a telnet server from a Rails application. After having actually used GServer in anger, I can add a few notes to it:
ACCESSING YOUR SERVER REMOTELY
This one took way too long to figure out. Every example I’ve seen online (even the library documentation) will only let you connect from localhost, which seemed even more exceptionally pointless than the stuff I usually do. Most of the sample code runs along these lines:
…where “1234” is the port used to access the server. With this setup, you simply cannot access the server from another box, period. Change the following line:
…to:
…to make your new server accessible to the outside world. You can use an IP address in place of the domain name.
On the one hand, I was able to just guess at this parameter, and Ruby’s Principle of Least Surprise came through for me. It’s more secure, as you don’t have to worry about accidentally exposing a massive security hole on your box during development. On the other hand, it would have been nice to have it clearly listed out somewhere. Here’s hoping that this saves some future googler a guessing game.
Comments
awesome said on Thursday, March 26, 2009:
as a future googler, this blog post saved me time. Do you have any more info related to using gserver with the outside world? thanks!
Calamitous said on Monday, July 13, 2009:
Hey, glad to hear it helped you out! Unfortunately, I haven’t played with GServer in quite some time… I’ve moved on to EventMachine. It takes a little more effort to wrap your head around it, but it’s much cleaner, faster, and has more heart-healthy fiber!