Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1546)

Unified Diff: net/tools/testserver/testserver.py

Issue 312593002: Print out the scheme in the test server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/testserver/testserver.py
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index c7af46b06360d8bab3187aa89a544131c61b40a1..22ec4cc6ad5155ad50173167b8948ff0ddef98c2 100755
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -2010,10 +2010,12 @@ class ServerRunner(testserver_base.TestServerRunner):
"base64"),
self.options.fallback_scsv,
stapled_ocsp_response)
- print 'HTTPS server started on %s:%d...' % (host, server.server_port)
+ print 'HTTPS server started on https://%s:%d...' % \
+ (host, server.server_port)
else:
server = HTTPServer((host, port), TestPageHandler)
- print 'HTTP server started on %s:%d...' % (host, server.server_port)
+ print 'HTTP server started on http://%s:%d...' % \
+ (host, server.server_port)
server.data_dir = self.__make_data_dir()
server.file_root_url = self.options.file_root_url
@@ -2026,7 +2028,9 @@ class ServerRunner(testserver_base.TestServerRunner):
# is required to work correctly. It should be fixed from pywebsocket side.
os.chdir(self.__make_data_dir())
websocket_options = WebSocketOptions(host, port, '.')
+ scheme = "ws"
if self.options.cert_and_key_file:
+ scheme = "wss"
websocket_options.use_tls = True
websocket_options.private_key = self.options.cert_and_key_file
websocket_options.certificate = self.options.cert_and_key_file
@@ -2041,7 +2045,8 @@ class ServerRunner(testserver_base.TestServerRunner):
self.options.ssl_client_ca[0] + ' exiting...')
websocket_options.tls_client_ca = self.options.ssl_client_ca[0]
server = WebSocketServer(websocket_options)
- print 'WebSocket server started on %s:%d...' % (host, server.server_port)
+ print 'WebSocket server started on %s://%s:%d...' % \
+ (scheme, host, server.server_port)
server_data['port'] = server.server_port
elif self.options.server_type == SERVER_TCP_ECHO:
# Used for generating the key (randomly) that encodes the "echo request"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698