| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """This is a simple HTTP/FTP/TCP/UDP/BASIC_AUTH_PROXY/WEBSOCKET server used for | 6 """This is a simple HTTP/FTP/TCP/UDP/BASIC_AUTH_PROXY/WEBSOCKET server used for |
| 7 testing Chrome. | 7 testing Chrome. |
| 8 | 8 |
| 9 It supports several test URLs, as specified by the handlers in TestPageHandler. | 9 It supports several test URLs, as specified by the handlers in TestPageHandler. |
| 10 By default, it listens on an ephemeral port and sends the port number back to | 10 By default, it listens on an ephemeral port and sends the port number back to |
| (...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2251 'algorithm(s) that will be accepted by the ' | 2251 'algorithm(s) that will be accepted by the ' |
| 2252 'SSL server. Valid values are "aes128gcm", ' | 2252 'SSL server. Valid values are "aes128gcm", ' |
| 2253 '"aes256", "aes128", "3des", "rc4". If ' | 2253 '"aes256", "aes128", "3des", "rc4". If ' |
| 2254 'omitted, all algorithms will be used. This ' | 2254 'omitted, all algorithms will be used. This ' |
| 2255 'option may appear multiple times, ' | 2255 'option may appear multiple times, ' |
| 2256 'indicating multiple algorithms should be ' | 2256 'indicating multiple algorithms should be ' |
| 2257 'enabled.'); | 2257 'enabled.'); |
| 2258 self.option_parser.add_option('--ssl-key-exchange', action='append', | 2258 self.option_parser.add_option('--ssl-key-exchange', action='append', |
| 2259 help='Specify the key exchange algorithm(s)' | 2259 help='Specify the key exchange algorithm(s)' |
| 2260 'that will be accepted by the SSL server. ' | 2260 'that will be accepted by the SSL server. ' |
| 2261 'Valid values are "rsa", "dhe_rsa", ' | 2261 'Valid values are "rsa", "dhe_rsa". If ' |
| 2262 '"ecdhe_rsa". If omitted, all algorithms ' | 2262 'omitted, all algorithms will be used. This ' |
| 2263 'will be used. This option may appear ' | 2263 'option may appear multiple times, ' |
| 2264 'multiple times, indicating multiple ' | 2264 'indicating multiple algorithms should be ' |
| 2265 'algorithms should be enabled.'); | 2265 'enabled.'); |
| 2266 # TODO(davidben): Add ALPN support to tlslite. | 2266 # TODO(davidben): Add ALPN support to tlslite. |
| 2267 self.option_parser.add_option('--enable-npn', dest='enable_npn', | 2267 self.option_parser.add_option('--enable-npn', dest='enable_npn', |
| 2268 default=False, const=True, | 2268 default=False, const=True, |
| 2269 action='store_const', | 2269 action='store_const', |
| 2270 help='Enable server support for the NPN ' | 2270 help='Enable server support for the NPN ' |
| 2271 'extension. The server will advertise ' | 2271 'extension. The server will advertise ' |
| 2272 'support for exactly one protocol, http/1.1') | 2272 'support for exactly one protocol, http/1.1') |
| 2273 self.option_parser.add_option('--file-root-url', default='/files/', | 2273 self.option_parser.add_option('--file-root-url', default='/files/', |
| 2274 help='Specify a root URL for files served.') | 2274 help='Specify a root URL for files served.') |
| 2275 # TODO(ricea): Generalize this to support basic auth for HTTP too. | 2275 # TODO(ricea): Generalize this to support basic auth for HTTP too. |
| 2276 self.option_parser.add_option('--ws-basic-auth', action='store_true', | 2276 self.option_parser.add_option('--ws-basic-auth', action='store_true', |
| 2277 dest='ws_basic_auth', | 2277 dest='ws_basic_auth', |
| 2278 help='Enable basic-auth for WebSocket') | 2278 help='Enable basic-auth for WebSocket') |
| 2279 self.option_parser.add_option('--ocsp-server-unavailable', | 2279 self.option_parser.add_option('--ocsp-server-unavailable', |
| 2280 dest='ocsp_server_unavailable', | 2280 dest='ocsp_server_unavailable', |
| 2281 default=False, action='store_true', | 2281 default=False, action='store_true', |
| 2282 help='If set, the OCSP server will return ' | 2282 help='If set, the OCSP server will return ' |
| 2283 'a tryLater status rather than the actual ' | 2283 'a tryLater status rather than the actual ' |
| 2284 'OCSP response.') | 2284 'OCSP response.') |
| 2285 self.option_parser.add_option('--alert-after-handshake', | 2285 self.option_parser.add_option('--alert-after-handshake', |
| 2286 dest='alert_after_handshake', | 2286 dest='alert_after_handshake', |
| 2287 default=False, action='store_true', | 2287 default=False, action='store_true', |
| 2288 help='If set, the server will send a fatal ' | 2288 help='If set, the server will send a fatal ' |
| 2289 'alert immediately after the handshake.') | 2289 'alert immediately after the handshake.') |
| 2290 | 2290 |
| 2291 | 2291 |
| 2292 if __name__ == '__main__': | 2292 if __name__ == '__main__': |
| 2293 sys.exit(ServerRunner().main()) | 2293 sys.exit(ServerRunner().main()) |
| OLD | NEW |