{"id":20397764,"url":"https://github.com/belingud/httpie-websockets","last_synced_at":"2025-04-12T13:09:47.385Z","repository":{"id":249517884,"uuid":"831733803","full_name":"belingud/httpie-websockets","owner":"belingud","description":"Websockets suport for HTTPie cli","archived":false,"fork":false,"pushed_at":"2024-11-18T13:41:38.000Z","size":211,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T13:09:38.983Z","etag":null,"topics":["httpie","plugin","websocket","websocket-client","websockets"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/httpie-websockets/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/belingud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-21T13:23:36.000Z","updated_at":"2025-04-04T17:42:04.000Z","dependencies_parsed_at":"2024-08-25T14:25:24.538Z","dependency_job_id":"533c5e42-130e-4749-8254-a5ba0e2d6629","html_url":"https://github.com/belingud/httpie-websockets","commit_stats":null,"previous_names":["belingud/httpie-websockets"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belingud%2Fhttpie-websockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belingud%2Fhttpie-websockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belingud%2Fhttpie-websockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belingud%2Fhttpie-websockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/belingud","download_url":"https://codeload.github.com/belingud/httpie-websockets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571884,"owners_count":21126522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["httpie","plugin","websocket","websocket-client","websockets"],"created_at":"2024-11-15T04:16:38.625Z","updated_at":"2025-04-12T13:09:47.365Z","avatar_url":"https://github.com/belingud.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# httpie-websockets\n\n[![PyPI version](https://img.shields.io/pypi/v/httpie-websockets?style=for-the-badge)](https://pypi.org/project/httpie-websockets/) [![License](https://img.shields.io/github/license/belingud/httpie-websockets.svg?style=for-the-badge)](https://opensource.org/licenses/MIT) ![Static Badge](https://img.shields.io/badge/language-Python-%233572A5?style=for-the-badge) ![PyPI - Downloads](https://img.shields.io/pypi/dm/httpie-websockets?logo=python\u0026style=for-the-badge) ![Pepy Total Downlods](https://img.shields.io/pepy/dt/httpie-websockets?style=for-the-badge\u0026logo=python)\n\nHome: https://github.com/belingud/httpie-websockets\n\n\n\u003c!-- TOC --\u003e\n* [httpie-websockets](#httpie-websockets)\n  * [Features](#features)\n  * [Install](#install)\n  * [Usage](#usage)\n    * [Debug Log](#debug-log)\n    * [Proxy \u0026 Cert](#proxy--cert)\n    * [Headers](#headers)\n    * [Subprotocol](#subprotocol)\n    * [Auth](#auth)\n    * [Session](#session)\n    * [Verify](#verify)\n    * [Timeout](#timeout)\n    * [~~Messages Download~~](#messages-download)\n    * [Multi-line Input Support](#multi-line-input-support)\n  * [Uninstall](#uninstall)\n\u003c!-- TOC --\u003e\n\n`httpie-websockets` is an HTTPie CLI plugin that adds WebSocket support to the HTTPie command line.\n\n## Features\n\n- **WebSocket Support:** Seamlessly connect to WebSocket servers using the familiar HTTPie command line interface.\n- **Bidirectional Communication:** Send and receive messages in real-time.\n- **Secure Connections:** Supports both `ws://` and `wss://` protocols.\n- **Easy Integration:** Simple installation and usage within the HTTPie environment.\n\n## Install\n\nYou can install by httpie plugins command:\n\n```shell\nhttpie plugins install httpie-websockets\n```\n\nor use pip in the same environment with httpie\n\n```shell\npip install httpie-websockets\n```\n\nIf your `httpie` is installed with `pipx`, you also can use `pipx` to install `httpie-websockets`.\n\nSuppose your httpie environment is named httpie.\n\n```shell\n# Replace httpie with your httpie venv name\npipx runpip httpie install -U httpie-websockets\n```\n\nIf your `httpie` is installed by `uv`.\n\n```shell\nuv tool install httpie --with httpie-websockets\n```\n\n## Usage\n\nAfter install this plugin, just pass websocket url to `http` command.\n\n```shell\nhttp ws://localhost:8000/ws\n```\n\nThis allows HTTPie to interact with WebSocket servers directly from the command line.\n\nExample:\n\n```shell\n$ http wss://echo.websocket.org\nRequest served by 7811941c69e658  \u003c== This msg is from server\n\u003e Connected to wss://echo.websocket.org\n\u003e Type a message and press enter to send it.\n\u003e The backslash at the end of a line is treated as input not ended.\n\u003e Press Ctrl+C to close the connection.\n\n```\n\nWhen you press CTRL+C, connection will disconnect and httpie will get handshake response headers\nand websocket connection info with close code and close message like below:\n\n```shell\n^C\nOops! Disconnecting. Need to force quit? Press again!\nHTTP/1.1 200\nconnection: Upgrade\ndate: Thu, 15 Aug 2024 13:24:10 GMT\nfly-request-id: 01J5B3BHGV549MMJQ474SF7J60-sin\nsec-websocket-accept: MV41qn7qZQP3IXsTzYS5eDRe2tE=\nserver: Fly/ddfe15ec (2024-08-14)\nupgrade: websocket\nvia: 1.1 fly.io\n\nWebsocket connection info:\nClose Code: 1006\nClose Msg: KeyboardInterrupt\n```\n\n### Debug Log\n\nYou can set `HTTPIE_WS_LOG_LEVEL` to `DEBUG` to see `httpie_websocket` debug log for more information.\n\nOn linux and Mac:\n\n```shell\nexport HTTPIE_WS_LOG_LEVEL=DEBUG\n```\nOr\n\n```shell\nHTTPIE_WS_LOG_LEVEL=DEBUG http wss://echo.websocket.org\n```\n\nOn Windows:\n\n```shell\nset HTTPIE_WS_LOG_LEVEL=DEBUG\n```\n\nOr\n\n```shell\n# Powershell\n$env:HTTPIE_WS_LOG_LEVEL=\"DEBUG\"; http wss://echo.websocket.org\n# Cmd\ncmd /C \"set HTTPIE_WS_LOG_LEVEL=DEBUG \u0026\u0026; http wss://echo.websocket.org\"\n```\n\n### Proxy \u0026 Cert\n\nThis project using `websocket-client` to establish connection, support proxy and custom cert file.\nYou can pass proxy and cert to httpie.\n\nSupport `http`, `socks4`, `socks4a`, `socks5` and `socks5h` proxy protocol.\n\n```shell\nhttp wss://echo.websocket.org --proxy=http://proxy.com\nhttp wss://echo.websocket.org --proxy=socks4://proxy.com\nhttp wss://echo.websocket.org --proxy=socks4a://proxy.com\nhttp wss://echo.websocket.org --proxy=socks5://proxy.com\nhttp wss://echo.websocket.org --proxy=socks5h://proxy.com\n```\n\nCustom cert file same as httpie.\n\n```shell\nhttp wss://yourservice.com --cert=/path/to/cert --cert-key=/path/to/cert-key --cert-key-pass=pass\n```\n\n### Headers\n\nAlso support custom headers, you can send header through httpie.\n\n**Note** `wss://echo.websocket.org` does not support any authentication, and will ignore any headers you send.\n\n\n```shell\nhttp wss://echo.websocket.org Custom-Header:Custom-value\n```\n\n### Subprotocol\n\nYou can send subprotocols from the headers.\nMultiple subprotocols need to be separated by commas, since httpie receives only the first one with the same headers key.\n\n```shell\nhttp wss://echo.websocket.org Sec-WebSocket-Protocol:sub1,sub2\n```\n\n### Auth\n\nSupport pass auth option and auth-type.\n\n**basic**: httpie use basic auth as default.\n\n```shell\nhttp wss://echo.websocket.org --auth=user1:pass\n```\n\nWebsocket server will receive a header like `'Authorization': 'Basic dXNlcjE6dGVzdA=='`.\n\n**bearer**: similar with basic.\n\n```shell\nhttp wss://echo.websocket.org --auth-type=bearer --auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\n```\n\nWebsocket server will receive a header like `'Authorization': 'Bearer eyxxxx'`\n\n**digest**: Technically, digest authentication is not supported, but you can generate an auth\nheader manually if you want.\n\n```shell\nhttp wss://echo.websocket.org \"Authorization: Digest username='user', realm='example', nonce='c3a7f38c-5e5a-45b2-a5b5-3b5e2c5c5c5c', uri='/path/to/protected/resource', response='generated_response', qop=auth, nc=00000001, cnonce='generated_cnonce', opaque='6d6b8f8f-6b8f-6b8f-6b8f-6b8f6b8f6b8f'\"\n```\n\n### Session\n\nSupport session option and perform as a header.\n\n```shell\nhttp wss://echo.websocket.org -s user1\n```\n\nSimilar like basic auth, server will receive a header like `'Authorization': 'Basic dXNlcjE6dGVzdA=='`.\n\n### Verify\n\nYou can disable SSL verification by using the --verify=no option\n\n```shell\nhttp wss://echo.websocket.org --verify=no\n```\n\n### Timeout\n\nPass time out option to waiting for connection establish.\n\n```shell\nhttp wss://echo.websocket.org --timeout=3\n```\n\n### ~~Messages Download~~\n\nMessage download functionality is no longer supported\nbecause the plugin cannot access the httpie environment,\nmaking it impossible to manage both stdout and messages simultaneously.\n\n\n### Multi-line Input Support\n\nThe backslash at the end of a line is treated as input not ended, **only the end-of-line**.\n\nIf you want to input a multiline input, use `\\` at the end of the line just like bash.\n\nExample:\n\nOne backslash at the end of a line\n```text\nhello\\\n world!\n```\n\nWill send as `hello world!`\n\nMultiple backslashes at the end of a line\n```text\nhello\\\\\\\n  world!\n```\n\nWill send as `hello\\  world!`, assume you input two whitespace ahead of `world!`.\n\nNot at the end-of-line\n```text\nhel\\\\lo\\\n world!\n```\n\nWill send as `hel\\\\lo world!`\n\n## Uninstall\n\nIf you want to uninstall this plugin, use the same way when you install.\n\nInstalled by `httpie` command, uninstall by\n\n```shell\nhttpie plugins uninstall httpie-websockets\n```\n\nInstalled by `pip` command, uninstall by\n\n```shell\npip uninstall httpie-websockets\n```\n\nInstalled by `uv`,\n\n```shell\nuv install httpie\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelingud%2Fhttpie-websockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbelingud%2Fhttpie-websockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelingud%2Fhttpie-websockets/lists"}