Python bindings for rathole reverse tunneling proxy
Project description
PyRathole
Python bindings for rathole, a high-performance reverse tunnelling proxy.
🚀 Quick Start
Installation
pip install pyrathole
Basic Usage
import pyrathole
# Start rathole server
pyrathole.start_server("/path/to/server.toml")
# Start rathole client
pyrathole.start_client("/path/to/client.toml")
# Get rathole version
version = pyrathole.version()
print(f"Rathole version: {version}")
Note: This package requires rathole to be installed on your system. Download from rathole releases.
📋 Requirements
- Python 3.8+
- rathole binary installed on your system
- Valid rathole configuration files
⚙️ Configuration
PyRathole uses the same configuration format as native rathole. See the rathole documentation for detailed configuration options.
Example Server Config (server.toml)
[server]
bind_addr = "0.0.0.0:2333"
[server.services.web]
type = "tcp"
bind_addr = "0.0.0.0:8080"
token = "your-secret-token"
Example Client Config (client.toml)
[client]
remote_addr = "your.server.com:2333"
[client.services.web]
type = "tcp"
local_addr = "127.0.0.1:8080"
token = "your-secret-token"
🔧 API Reference
Functions
start_server(config_path: str)- Start rathole server with given config filestart_client(config_path: str)- Start rathole client with given config fileversion() -> str- Get installed rathole version
Error Handling
import pyrathole
try:
pyrathole.start_server("server.toml")
except RuntimeError as e:
print(f"Failed to start server: {e}")
🐛 Troubleshooting
| Error | Cause | Solution |
|---|---|---|
RuntimeError: Failed to start rathole |
rathole not found in PATH | Install rathole from releases |
RuntimeError: Rathole failed |
Invalid config or network issues | Check configuration file and network connectivity |
RuntimeError: Failed to get version |
rathole not installed | Ensure rathole is properly installed |
📚 Documentation
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📄 License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
🙏 Acknowledgments
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 Distributions
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
File details
Details for the file pyrathole-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pyrathole-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 204.6 kB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69bc844626f212b77da4d2ac937d8110a00d738877d2fff06deb3231c9e207b6
|
|
| MD5 |
c9227133ba3ec5f746653ef99cce1547
|
|
| BLAKE2b-256 |
b0067e161a7f0f8cce6a154d4a2b4003604658e1d7bebe41fc774db2c0a65a70
|