WebSocket Tunnel - 透明反向代理隧道,支持服务端嵌入和客户端 SDK
Project description
WS-Tunnel Python SDK
WebSocket 透明反向代理隧道 - Python 服务端和客户端 SDK。
详见上级目录的 README.md。
安装
pip install -e .
使用
服务端
from fastapi import FastAPI
from tunely import TunnelServer, TunnelServerConfig
app = FastAPI()
tunnel_server = TunnelServer()
app.include_router(tunnel_server.router)
@app.on_event("startup")
async def startup():
await tunnel_server.initialize()
客户端
from tunely import TunnelClient
client = TunnelClient(
server_url="ws://server/ws/tunnel",
token="tun_xxx",
target_url="http://localhost:8080"
)
await client.run()
命令行
ws-tunnel connect --token tun_xxx --target http://localhost:8080
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tunely-0.1.2.tar.gz
(32.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
tunely-0.1.2-py3-none-any.whl
(20.4 kB
view details)
File details
Details for the file tunely-0.1.2.tar.gz.
File metadata
- Download URL: tunely-0.1.2.tar.gz
- Upload date:
- Size: 32.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
117b91c80ab1f4e7647ed5cf1fb6d730cc92d1e027374a6cac96a99f9a047cbd
|
|
| MD5 |
c8eda127ece60c9208b886cda4495669
|
|
| BLAKE2b-256 |
d314809840f7aa9abca861bc857201d7b6c478c784005cd460b806f9b16afdeb
|
File details
Details for the file tunely-0.1.2-py3-none-any.whl.
File metadata
- Download URL: tunely-0.1.2-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93100f8e53c5af435476fff09eeca3c8400510299c6f9adf4c4b863424b59b5b
|
|
| MD5 |
2198bae5a84a802ee2b187e38339e564
|
|
| BLAKE2b-256 |
745f9154ed065d18bc1daaa15e69dbf0a24835c25938fe116819eabc3a3e6c24
|