浏览器代理服务器
Project description
Orion Server
Orion是一个提供终端模拟器和浏览器代理功能的服务器。它可以作为独立服务运行,也可以作为Python包导入使用。
功能特点
- 终端模拟器:执行命令、获取输出历史
- 浏览器代理:控制浏览器操作,自动化网页交互
- 文本编辑器:读取和写入文件
- 文件上传:支持单文件和分片上传到S3
- 文件下载:支持批量下载远程文件
- 项目打包:支持将项目打包上传到云端
安装
方法1: 使用pip安装(推荐用于导入使用)
pip install orion-server
方法2: 从源码安装(推荐用于开发)
git clone https://github.com/yourusername/orion.git
cd orion
pip install -e .
使用方法
作为服务使用
方法1: 使用命令行工具
安装后,可以直接使用命令行工具启动服务:
# 使用默认配置启动
orion-server
# 指定端口和日志级别
orion-server --port 8888 --log-level debug
# 开发模式(自动重载)
orion-server --reload
方法2: 使用Python脚本启动
python start_server.py --port 8330
作为库导入使用
可以将Orion作为Python库导入使用,示例代码:
import asyncio
from app import BrowserManager, terminal_manager, text_editor
# 初始化浏览器管理器
async def browser_example():
browser = BrowserManager(headless=False)
await browser.initialize()
# 执行浏览器操作...
await browser.close()
# 使用终端管理器
async def terminal_example():
terminal = await terminal_manager.create_or_get_terminal("my_terminal")
await terminal.execute_command("ls -la")
history = terminal.get_history(True, True)
# 处理终端输出...
# 运行示例
asyncio.run(browser_example())
更多示例请参考 examples/use_as_package.py。
Docker部署
# 构建容器
docker build -t orion-server .
# 运行容器
docker run -p 8330:8330 orion-server
API文档
启动服务后,访问 http://localhost:8330/docs 查看API文档。
许可证
MIT
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
orion_browser-0.1.4.tar.gz
(125.7 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
orion_browser-0.1.4-py3-none-any.whl
(137.7 kB
view details)
File details
Details for the file orion_browser-0.1.4.tar.gz.
File metadata
- Download URL: orion_browser-0.1.4.tar.gz
- Upload date:
- Size: 125.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d7d21df12559f1012db830e26d79488f79a4a06d3d1f03d05ca86134d30c155
|
|
| MD5 |
0468214ccddeb2f619ff6f29280e5c60
|
|
| BLAKE2b-256 |
a85a6466e4f6541dccf42f6e9f311b68d71732109a76abc7540ca186445af48c
|
File details
Details for the file orion_browser-0.1.4-py3-none-any.whl.
File metadata
- Download URL: orion_browser-0.1.4-py3-none-any.whl
- Upload date:
- Size: 137.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15400f2010a7e39c13464c72fd92e7827875323b8d4002acfc23426c5b48bd9d
|
|
| MD5 |
3a563e66016b2d5ff89358ad8c74a1b1
|
|
| BLAKE2b-256 |
748988c2a6e71381996712665f8d5a2416752912418cced65047ea95481d749f
|