diff options
| author | Andrey Oleynik <aoleynik@vispateam.ru> | 2016-10-05 17:21:14 +0300 |
|---|---|---|
| committer | Andrey Oleynik <aoleynik@vispateam.ru> | 2016-10-05 17:21:14 +0300 |
| commit | b7ad1a13c70778c2331bbdccb6be5ac2ac7240e3 (patch) | |
| tree | efc2190046cd15b56793cd740800de9c2ab3411a /bin/wsdump.py | |
| parent | 36cf2e63e4f5b34448e5d3b0c74e7f4639701215 (diff) | |
| download | websocket-client-b7ad1a13c70778c2331bbdccb6be5ac2ac7240e3.tar.gz | |
Pass headers for websocket handshake
Diffstat (limited to 'bin/wsdump.py')
| -rwxr-xr-x | bin/wsdump.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/wsdump.py b/bin/wsdump.py index 5af00ac..e06271c 100755 --- a/bin/wsdump.py +++ b/bin/wsdump.py @@ -65,6 +65,8 @@ def parse_args(): help="Send initial text") parser.add_argument("--timings", action="store_true", help="Print timings in seconds") + parser.add_argument("--headers", + help="Set custom headers. Use ',' as separator") return parser.parse_args() @@ -126,6 +128,8 @@ def main(): opts = {} if args.nocert: opts = {"cert_reqs": websocket.ssl.CERT_NONE, "check_hostname": False} + if args.headers: + options['header'] = map(str.strip, args.headers.split(',')) ws = websocket.create_connection(args.url, sslopt=opts, **options) if args.raw: console = NonInteractive() |
