Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Basic WebSocket Client Support in CLI

未关闭
#1,697 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
python
领域
cli, networking

调研方向

该 issue 没有指出任何文件、测试或入口点。首先定位 CLI 的 URL scheme dispatch 以及现有的连接和错误处理路径,然后跟踪请求如何发送以及其响应如何打印。完成意味着 ws:// 和 wss:// 接受一条文本消息,打印一个响应帧,处理列出的失败情况,并干净地退出。

由索引模型根据 Issue 内容生成。

描述

enhancement new

Checklist

  • I've searched for similar feature requests.

Enhancement request

Add Basic WebSocket Client Support (ws://, wss://)

Introduce minimal WebSocket support to HTTPie CLI, allowing users to:

  • Connect to a ws:// or wss:// endpoint
  • Send a single text message via CLI argument
  • Receive and print one response frame
  • Exit cleanly

When a WebSocket scheme is detected, the CLI should establish a WebSocket connection instead of performing an HTTP request.

Example usage:

http ws://echo.websocket.events message="hello"

Expected behavior:

  1. Establish WebSocket connection
  2. Send the provided message as a text frame
  3. Print the first received text frame
  4. Exit successfully

Basic error handling should cover:

  • Invalid WebSocket URLs
  • TLS errors (wss://)
  • Connection timeouts
  • Unsupported/binary frames

This feature is intentionally scoped to provide minimal, non-interactive WebSocket testing support.


Problem it solves

I'm frequently testing APIs that expose both HTTP and WebSocket endpoints. While HTTPie works well for HTTP/HTTPS requests, I need to switch to another tool when validating WebSocket behavior.

I’m trying to test real-time endpoints quickly from the terminal so that I can verify message flow without leaving my CLI workflow.

Adding minimal WebSocket support would:

  • Reduce context switching
  • Improve developer productivity
  • Make HTTPie more versatile for modern API development

Additional information, screenshots, or code examples

Proposed Scope Constraints

To keep the implementation focused and maintainable:

  • No interactive REPL mode
  • No continuous streaming session
  • No advanced protocol extensions
  • Single-message request/response flow only

Future enhancements (if needed) could extend this to streaming or interactive mode.

I would be happy to work on this enhancement and submit a pull request if the maintainers agree with the proposed scope.

主要语言
Python
星标
38.6k
派生
4k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

httpie/cli 的其他 Issue

查看 httpie/cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。