Python Server on different IP address
Question: So I have a web server that I can run using python, but I have a question. Can
I change the IP address where the server runs the only one I can get to work
is 127.0.0.1 which is the localhost address? I have already tried with no luck
I want to use a unused one on my network.

Here's the code:

    
    
    import sys
    import BaseHTTPServer
    from SimpleHTTPServer import SimpleHTTPRequestHandler
    HandlerClass = SimpleHTTPRequestHandler
    ServerClass = BaseHTTPServer.HTTPServer
    Protocol = "HTTP/1.0"
    if sys.argv[1:]:
          port = int(sys.argv[1])
    else:
          port = 8000
    server_address = ('127.0.0.1', port)
    HandlerClass.protocol_version = Protocol
    httpd = ServerClass(server_address, HandlerClass) 
    sa = httpd.socket.getsockname()
    print "Running server on", sa[0], "port", sa[1], "..."
    httpd.serve_forever()
    


Answer: You can only use addresses that are bound to a network interface on the
computer. You cannot use random addresses picked out of thin air.

