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.1.tar.gz
(20.9 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.1-py3-none-any.whl
(19.7 kB
view details)
File details
Details for the file tunely-0.1.1.tar.gz.
File metadata
- Download URL: tunely-0.1.1.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c8eb194c713b6141fe32c6f0b79f833a6c4f9ec28e54d14402877dd6203e143
|
|
| MD5 |
290f5774785b3386744ffd92a7d0bfd2
|
|
| BLAKE2b-256 |
ec293d7c0b97ff3f8dc92d18eb51034284fbf872ba002a87b66eb7ea187f3fbb
|
File details
Details for the file tunely-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tunely-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc679f6917b87dcdaa8c7f3b0956917380dda62071538fc1f7ba6fb4a31f8818
|
|
| MD5 |
3f69beb02c55d7645ac83c4dc1a48e47
|
|
| BLAKE2b-256 |
7d8eac2a4d42bb6be9f4149271d59a79ddec74c4ea6496b7c5b93d2dc69ff79f
|