Print My Bridge is a desktop application that creates a secure HTTP bridge for remote printing. It allows you to send print jobs to local printers through a REST API with authentication and rate limiting.
- 🖨️ Remote Printing: Send print jobs to local printers via HTTP API
- 🔐 Secure Authentication: Token-based API authentication
- 🚦 Rate Limiting: Configurable request rate limiting
- 🎯 Cross-Platform: Available for Windows, macOS, and Linux
- ⚙️ Configurable: Flexible configuration options
- 🔄 Auto-Start: Optional system startup integration
- 📱 System Tray: Minimize to system tray support
- 🌐 CORS Support: Configurable cross-origin resource sharing
- Operating System: Windows 10+, macOS 10.13+, or Linux
- Rust: 1.70+ (for development)
- Node.js: 16+ (for development)
Download the latest release for your platform from the Releases page:
- Windows:
Print My Bridge_x.x.x_x64_en-US.msi
- macOS:
Print My Bridge.app
(Universal binary) - Linux:
print-my-bridge_x.x.x_amd64.deb
-
Clone the repository:
git clone https://github.com/your-username/print-my-bridge.git cd print-my-bridge
-
Install Rust and Tauri CLI:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh cargo install tauri-cli
-
Build the application:
cd src-tauri cargo tauri build
The application uses a TOML configuration file located at:
- Windows:
%APPDATA%/print-my-bridge/print-my-bridge.toml
- macOS:
~/Library/Application Support/print-my-bridge/print-my-bridge.toml
- Linux:
~/.config/print-my-bridge/print-my-bridge.toml
# Server configuration
host = "127.0.0.1"
port = 8765
max_file_size_mb = 10
rate_limit_per_minute = 60
# Application settings
auto_start = false
minimize_to_tray = true
# Security settings
allowed_origins = ["*"]
allowed_file_types = [".pdf", ".txt", ".doc", ".docx"]
default_printer = ""
- Generate a token through the application UI
- Include the token in your API requests:
curl -H "Authorization: Bearer YOUR_TOKEN" \ -F "file=@document.pdf" \ http://localhost:8765/api/print
GET /health
Response:
{
"status": "ok",
"service": "print-my-bridge",
"version": "0.1.0"
}
GET /api/printers
Authorization: Bearer YOUR_TOKEN
Response:
{
"printers": [
{
"name": "HP LaserJet Pro",
"is_default": true,
"status": "ready"
}
]
}
POST /api/print
Authorization: Bearer YOUR_TOKEN
Content-Type: multipart/form-data
Parameters:
file
: Document file (required)printer
: Printer name (optional, uses default if not specified)copies
: Number of copies (optional, default: 1)
Example:
curl -X POST \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@document.pdf" \
-F "printer=HP LaserJet Pro" \
-F "copies=2" \
http://localhost:8765/api/print
Response:
{
"success": true,
"message": "Document sent to printer successfully",
"job_id": "12345"
}
print-my-bridge/ ├── src-tauri/ # Rust backend │ ├── src/ │ │ ├── api/ # HTTP API routes │ │ ├── config/ # Configuration management │ │ ├── gui/ # Tauri commands │ │ ├── printer/ # Printer integration │ │ └── main.rs # Application entry point │ └── tauri.conf.json # Tauri configuration ├── ui/ # Frontend UI │ ├── index.html │ ├── script.js │ └── style.css └── README.md
-
Install dependencies:
cd src-tauri cargo build
-
Run in development mode:
cargo tauri dev
-
Run tests:
cargo test
# Intel (x86_64)
cargo tauri build --target x86_64-apple-darwin
# Apple Silicon (M1/M2)
cargo tauri build --target aarch64-apple-darwin
# Universal binary
cargo tauri build --target universal-apple-darwin
rustup target add x86_64-pc-windows-msvc
cargo tauri build --target x86_64-pc-windows-msvc
rustup target add x86_64-unknown-linux-gnu
cargo tauri build --target x86_64-unknown-linux-gnu
Use the included build script for all platforms:
./build-all.sh
- Token Authentication: All API endpoints (except
/health
) require a valid bearer token - Rate Limiting: Configurable request rate limiting to prevent abuse
- CORS Protection: Configurable allowed origins
- File Type Validation: Restrict allowed file types for printing
- Local Network Only: Server binds to localhost by default
- Check if the application is running in the system tray
- Verify the configuration file exists and is valid
- Check if the configured port is available
- Ensure the application is running
- Verify the correct host and port in configuration
- Check firewall settings
- Verify the printer is connected and online
- Check if the file type is allowed in configuration
- Ensure the file size doesn't exceed the limit
- Update
allowed_origins
in configuration - Use specific origins instead of
*
for production
Run the application from terminal to see detailed logs:
cd src-tauri
cargo run
Application logs can be found at:
- Windows:
%APPDATA%/print-my-bridge/logs/
- macOS:
~/Library/Logs/print-my-bridge/
- Linux:
~/.local/share/print-my-bridge/logs/
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow Rust coding conventions
- Add tests for new features
- Update documentation as needed
- Ensure cross-platform compatibility
This project is licensed under the MIT License - see the LICENSE file for details.
- Tauri - For the amazing desktop app framework
- Warp - For the HTTP server framework
- Tokio - For async runtime
- Serde - For serialization
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Include logs and configuration details
- Basic printing functionality
- Token-based authentication
- Rate limiting
- Cross-platform support
- System tray integration
- Configuration management