Features
- Docker support for easy deployment.
- Proxy support by default (can be disabled via features).
- Optional impersonation using the
impersonatefeature to mimic browser settings.
Usage
Docker Deployment
- Clone the repository:
git clone https://github.com/hominsu/deeplx-rs.git - Start the container:
cd deploy docker-compose up -d
Install with Cargo
cargo install
If you want to mimic browser settings, use the impersonate feature:
cargo install --features="impersonate"
Note: The
impersonatefeature relies on therquestcrate, which may not be stable. Additionally, build artifacts may increase by ~50%.
Integration
Installation
Add deeplx to your Cargo.toml:
[]
= "1"
By default, deeplx includes proxy support. If you do not need proxy support, disable the default features:
[]
= { = "1", = false }
If you want to enable the impersonate feature to mimic browser headers, TLS settings, etc.:
[]
= { = "1", = ["impersonate"] }
Configuration
deeplx is configured via the Config struct. You can specify options such as proxy, timeout, and more. For example:
use ;
let translator = new;
If you have disabled the proxy feature, you can simply omit the proxy field:
use ;
let translator = new;
Usage
Below is an example using tokio for async execution:
use ;
async
Reference
License
Distributed under the MIT License. See LICENSE for more information.