Sign inSign up

ddio001/http2websocket

By ddio001

•Updated about 4 years ago

A proxy sending HTTP requests to WebSocket client.

Image
0

393

ddio001/http2websocket repository overview

⁠http2websocket proxy

Python Version License GitHub commit activity lines⁠

A proxy sending HTTP requests to WebSocket client. Make the WebSocket client a Webhook server.

把 http 请求转发到 WebSocket 客户端的代理,为 WebSocket 客户端实现 Webhook server 的功能。

⁠快速开始 Quick Start

  1. 使用 docker 部署。 Deploy with docker.
docker run -d -p 80:80 ddio001/http2websocket
  1. 发起 WebSocket 连接。 Create a WebSocket connection.

  2. 发起 http 请求。 Send http requests.

curl 'http://localhost/haha' -H 'Content-Type: application/json' --data '{"msg":"wow"}'
  1. 在 WebSocket 客户端查看消息。 View messages in WebSocket client.
{
  "path": "/haha",
  "method": "POST",
  "headers" :{
    "Content-Type": "application/json"
  },
  "content": {
    "msg": "wow"
  }
}

⁠开发相关 Development

⁠使用技术 Technology Stack
⁠运行时Python包 Runtime Python Package

⁠从代码开始 Start from Code

⁠调试 Debugging
  1. 安装依赖。 Install requirements.
pip install fastapi[all]
  1. 启动服务器。 Start the server.
cd src
uvicorn main:app --reload
⁠构建 Docker Image
docker build -t http2websocket .

Tag summary

Content type

Image

Digest

sha256:c873885be…

Size

70.2 MB

Last updated

about 4 years ago

docker pull ddio001/http2websocket