1. Home
  2. Computing & Technology
  3. Python

Building a Simple Web Server in Python

By Al Lukaszewski, About.com

4 of 10

Hosts and Ports

As already mentioned, the server needs to know the host to which it is to be associated and the port on which to listen. For our purposes, we shall have the service apply to any host name at all.

host = ''
port = 8080
The port, as mentioned earlier, will be 8080. So note that, if you use this server in conjunction with the network client, you will need to change the port number used in that program.

4 of 10

Explore Python

More from About.com

  1. Home
  2. Computing & Technology
  3. Python
  4. Networking
  5. Python Web Server: Hosts and Ports

©2008 About.com, a part of The New York Times Company.

All rights reserved.