0

I'm just starting to use torando. I can run the standard "hello world" example:

import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
  def get(self):
    self.write("Hello, world")
application = tornado.web.Application([
     (r"/", MainHandler),
])
if __name__ == "__main__":
      application.listen(8888)
      tornado.ioloop.IOLoop.instance().start()

The server will be used only in an local network.

I can write in browser http//:192.168.0.20:8888 and get the "Hello world" page.

How can I create a server name (for example 'myHomeServer') and connect from browser using it: http://myHomeServer ? Thanks

Oscar Effe
  • 305
  • 2
  • 8

1 Answers1

1

If it is only to access it from the same machine:

  • in /etc/hosts, put:

    192.168.0.20 myhomeserver

If you need to access it from multiple machines, 2 solutions:

  • put the same line in every machine's /etc/hosts
  • create an A record in a dns server in your local network

    more info here if you have a linux server in your network.

In all these scenarios, you'll still have to add the port after the servername in your browser.

DevLounge
  • 8,313
  • 3
  • 31
  • 44
  • Hi Apero, i need to connect from different devices (smartphone, ipad, pcs) with different OS. So I need to go for the second chioce,so the question is how to create a A record now... – Oscar Effe Nov 12 '15 at 04:28