The C library allows you to embed Soracom Arc connectivity into your own program. You can send a message to the unified endpoint, with Soracom Arc, entirely from userspace (no root privilege is required).
- Go 1.21.5 darwin/arm64
- macOS Sonoma 14.1.2
- You have to have a virtual SIM, along with
arc.json
which is a configuration file forsoratun
locally. See documentation for detail.- Soracom Arc Soratun Tool (English)
- soratun を利用して接続する: soratun の概要と機能 (Japanese)
- You have to enable the unified endpoint for your SIM group. See documentation for detail.
- Unified Endpoint Overview (English)
- Unified Endpoint (Japanese)
$ git clone https://github.com/soracom/libsoratun
$ cd libsoratun
$ make libs
Tested with Python 3.12.0.
$ cd examples/python
$ python3 main.py /path/to/arc.json '{"message": "hey"}'
Tested with Node.js v18.19.0.
$ cd examples/nodejs
$ npm install
$ node src/index.js /path/to/arc.json '{"message": "hey"}'
Tested with Rust 1.74.1. In order to build Rust bindings, you have to install bindgen-cli and its prerequisites.
$ make bindings
$ cd examples/rust
$ cargo run -- --config /path/to/arc.json '{"message": "hey"}'
Tested with AWS Lambda Python 3.11 runtime.
-
Build a shared library on target platform. Tested on arm64.
$ make libs
-
Place
examples/lamdada/lambda_function.py
,lib/shared/libsoratun.so
, and yourarc.json
in a same directory. -
Zip it up and upload it to AWS Lambda function.
$ zip -r lambda.zip lambda_function.py libsoratun.so arc.json
MIT. See LICENSE for detail.