SMS Client
A remote client library for interfacing with the SMS-API, making it easy to send and receive SMS messages from Rust, all with your own hardware and no API subscriptions!
This also includes bindings to the SMS database, useful for retrieving previous messages and delivery states.
Installation
Simply use cargo add sms-client
Here's some other usage examples from inside a project Cargo.toml.
[]
# This includes ONLY the HttpClient.
= "1.4.1"
# This includes BOTH the HttpClient and WebSocketClient.
= { = "1.4.1", = ["websocket"] }
# This includes ONLY the WebSocketClient.
= { = "1.4.1", = false, = ["websocket"] }
Compilation Features
| Feature Name | Description | Default |
|---|---|---|
| http | Enables HttpClient to send commands to API . | Yes |
| websocket | Enables WebSocketClient to receive events from API. | No |
| http-rustls | Uses Rust-TLS for reqwest HTTP client. | Yes |
| http-default | Uses default TLS for reqwest HTTP client. | No |
Example Projects
Here are two example projects that use this crate:
- Pushover - Send Pushover notifications for Incoming messages.
- SMS-Terminal - Send and receive SMS messages via a TUI application.
Example Code
This is an example that listens for incoming SMS messages, and then replies with the same message content.
use Arc;
use SmsStoredMessage;
use WebsocketMessage;
use HttpOutgoingSmsMessage;
use ClientConfig;
use ClientResult;
use Client;
async