diff options
| author | ianb <devnull@localhost> | 2006-03-30 21:58:55 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2006-03-30 21:58:55 +0000 |
| commit | 81f9c7b3b6369a61ba0710835e01640a1afb68ac (patch) | |
| tree | 8fd27019936c27d9065d4571865ab02f91e4b5e7 /paste/httpserver.py | |
| parent | 4092fd73536b657bee918134e4df1ac65693d52f (diff) | |
| download | paste-81f9c7b3b6369a61ba0710835e01640a1afb68ac.tar.gz | |
Handle a host:port configuration
Diffstat (limited to 'paste/httpserver.py')
| -rwxr-xr-x | paste/httpserver.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/paste/httpserver.py b/paste/httpserver.py index 2ed816b..8c07233 100755 --- a/paste/httpserver.py +++ b/paste/httpserver.py @@ -421,7 +421,13 @@ def serve(application, host=None, port=None, handler=None, ssl_pem=None, ssl_context.use_privatekey_file(ssl_pem) ssl_context.use_certificate_file(ssl_pem) - server_address = (host or "127.0.0.1", int(port or 8080)) + host = host or '127.0.0.1' + if not port: + if ':' in host: + host, port = host.split(':', 1) + else: + port = 8080 + server_address = (host, int(port)) if not handler: handler = WSGIHandler |
