Volver al ranking

NdoleStudio/httpsms

Gohttpsms.com

Send and receive SMS messages using your Android phone programmatically via a simple HTTP API

smssms-apisms-managersms-manager-apiandroid-smsandroid-sms-senderhttpsmssms-gateway
Crecimiento de estrellas
Estrellas
3.7k
Forks
609
Crecimiento semanal
Issues
0
1k2k3k
ene 2023mar 2024may 2025jul 2026
ArtefactosGo Modulesgo get github.com/NdoleStudio/httpsms
README

httpSMS

Web API GitHub contributors GitHub license Contributor Covenant Scrutinizer Code Quality Better Stack Badge Sponsors Discord

httpSMS is a service that lets you use your Android phone as an SMS Gateway to send and receive SMS messages. You make a request to a simple HTTP API and it triggers your Android phone to send an SMS. SMS messages received on your android phone can also be forwarded to your webhook endpoint.

Quick Start Guide 👉 https://docs.httpsms.com

header

Table Of Contents

Why?

I'm originally from Cameroon and I wanted an automated way to send and receive SMS messages using an API. Unfortunately many countries don't support the ability to buy virtual phone numbers, and I could not find a good ready-made solution that could help me send/receive SMS messages using a mobile phone using an intuitive http API.

Web UI

The web interface https://httpsms.com is built using Nuxt and Vuetify. It is hosted as a single page application on firebase. The source code is in the web directory

API

The API https://api.httpsms.com is built using Fiber, Go and CockroachDB for the database. It rus as a serverless application on Google Cloud Run. The API documentation can be found here https://api.httpsms.com/index.html

// Sending an SMS Message using Go
client := htpsms.New(htpsms.WithAPIKey(/* API Key from https://httpsms.com/settings */))

client.Messages.Send(context.Background(), &httpsms.MessageSendParams{
    Content: "This is a sample text message",
    From:    "+18005550199",
    To:      "+18005550100",
})

Android App

The Android App is a native application built using Kotlin with material design principles. This app must be installed on an Android phone before you can start sending and receiving SMS messages.

Get it on GitHub

Chat/forum

There are a few ways to get in touch with me and/or the rest of the community. Feel free to use any of these methods. Whatever works best for you:

Features

End-to-end Encryption

You can encrypt your messages end-to-end ysubg the military grade AES-256 encryption algorithm. Your encryption key is stored only on our mobile phone so the even the server won't have any way to view the content of your SMS messages which are sent and received on your Android phone.

Webhook

If you want to build advanced integrations, we support webhooks. The httpSMS platform can forward SMS messages received on the android phone to your server using a callback URL which you provide.

Back Pressure

In-order not to abuse the SMS API on android, you can set a rate limit e.g 3 messages per minute. Such that even if you call the API to send messages to 100 people, It will only send the messages at a rate of 3 messages per minute.

Message Expiration

Sometimes it happens that the phone doesn't get the push notification in time and I can't send the SMS message. It is possible to set a timeout for which a message is valid and if a message becomes expired after the timeout elapses, you will be notified.

API Clients

Flows

Sending an SMS Message

sequenceDiagram
User->>+httpSMS API: Call /v1/messages/send API
httpSMS API-->>+Push Queue: Schedule notification about new message
httpSMS API-->>-User: Respond with 202 (Accepted)
Push Queue-->>+httpSMS API: [Async] Send notification request
httpSMS API-->>-Android App: Send push notification about new message
Android App-->>httpSMS API: [Async] Fetch message
Android App-->>Android App: Send Message using Android SMS API
Android App-->>httpSMS API: [Async] Send result of sending SMS
Android App-->>httpSMS API: [Async] Send Delivery Report

Self Host Setup - Docker

1. Setup Firebase

  • The httpSMS application uses firebase cloud messaging for sending push notifications to your Android phone to trigger an SMS message to be sent out. Visit the firebase console and create a new project and follow the steps here to get your firebase web SDK config credentials. For example, I created a firebase project called httpsms-docker and this is my web SDK configuration
const firebaseConfig = {
  apiKey: "AIzaSyAKqPvj51igvvNNcRtxxxxx",
  authDomain: "httpsms-docker.firebaseapp.com",
  projectId: "httpsms-docker",
  storageBucket: "httpsms-docker.appspot.com",
  messagingSenderId: "668063041624",
  appId: "1:668063041624:web:29b9e3b702796xxxx",
  measurementId: "G-18VRYL2xxxx",
};
  • Enable Email/Password sign-in in the Firebase console, open the Authentication section. On the Sign in method tab, enable the Email/password sign-in method and click Save.
  • Generate your firebase service account credentials by following the steps here and save the credentials in a file called firebase-credentials.json we will use this file to authenticate with the firebase admin SDK.
  • Generate your Android google-services.json file using the instructions here we will use it letter to configure the android app.

2. Setup SMTP Email service

The httpSMS application uses SMTP to send emails to users e.g. when your Android phone has been offline for a long period of time. You can use a service like mailtrap to create an SMTP server for development purposes.

3. Setup Cloudflare Turnstile

The message search route (/v1/messages/search) is protected by a Cloudflare Turnstile captcha to prevent abuse. You need to set up a Turnstile widget for the search messages feature to work.

  1. Go to the Cloudflare dashboard and navigate to Turnstile.
  2. Add a new site and configure it for your self-hosted domain (e.g., localhost for local development).
  3. Note down the Site Key and Secret Key — you will need them for the frontend and backend environment variables respectively.

4. Download the code

Clone the httpSMS GitHub repository

git clone https://github.com/NdoleStudio/httpsms.git

5. Setup the environment variables

  • Copy the .env.docker file in the web directory into .env
cp web/.env.docker web/.env
  • Update the environment variables in the .env file in the web directory with your firebase web SDK configuration in step 1 above
FIREBASE_API_KEY=
FIREBASE_AUTH_DOMAIN=
FIREBASE_PROJECT_ID=
FIREBASE_STORAGE_BUCKET=
FIREBASE_MESSAGING_SENDER_ID=
FIREBASE_APP_ID=
FIREBASE_MEASUREMENT_ID=

# Cloudflare Turnstile site key from step 3
CLOUDFLARE_TURNSTILE_SITE_KEY=
  • Copy the .env.docker file in the api directory into .env
cp api/.env.docker api/.env
  • Update the environment variables in the .env file in the api directory with your firebase service account credentials, SMTP server details, and Cloudflare Turnstile secret key.
# SMTP email server settings
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_HOST=
SMTP_PORT=

# Firebase service account credentials
FIREBASE_CREDENTIALS=

# This is the `projectId` from your firebase web config
GCP_PROJECT_ID=

# Cloudflare Turnstile secret key from step 3
CLOUDFLARE_TURNSTILE_SECRET_KEY=
  • Don't bother about the EVENTS_QUEUE_USER_API_KEY and EVENTS_QUEUE_USER_ID settings. We will set that up later.

6. Build and Run

  • Build and run the API, the web UI, database and cache using the docker-compose.yml file. It takes a while for build and download all the docker images. When it's finished, you'll be able to access the web UI at http://localhost:3000 and the API at http://localhost:8000
docker compose up --build

7. Create the System User

  • The application uses the concept of a system user to process events async. You should manually create this user in users table in your database. Make sure you use the same id and api_key as the EVENTS_QUEUE_USER_ID, and EVENTS_QUEUE_USER_API_KEY in your .env file.

    INSERT INTO users (id, api_key, email ) VALUES ('your-system-user-id', 'your-system-api-key', 'system@domain.com');
    

[!IMPORTANT] Restart your API docker container after modifying EVENTS_QUEUE_USER_ID, and EVENTS_QUEUE_USER_API_KEY in your .env file so that the httpSMS API can pick up the changes.

8. Build the Android App.

  • Before building the Android app in Android Studio, you need to replace the google-services.json file in the android/app directory with the file which you got from step 1. You need to do this for the firebase FCM messages to work properly.

Integration Testing

The project includes end-to-end integration tests that validate the complete SMS send/receive lifecycle. Tests run the full stack (API, PostgreSQL, Redis) in Docker alongside a phone emulator that simulates an Android device.

📖 Full documentation: tests/README.md

Quick run:

cd tests
bash generate-firebase-credentials.sh
export FIREBASE_CREDENTIALS=$(jq -c . firebase-credentials.json)
docker compose up -d --build --wait
docker compose wait seed && sleep 2
go test -v -timeout 120s ./...
docker compose down -v

Integration tests also run automatically in CI on every push/PR to main.

License

This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 - see the LICENSE file for details

Repositorios relacionados
novuhq/novu

The open-source communication infrastructure for agents and products

TypeScriptnpmOthernotificationscommunication
go.novu.co/github
39.3k4.4k
pppscn/SmsForwarder

短信转发器——监控Android手机短信、来电、APP通知,并根据指定规则转发到其他手机:钉钉群自定义机器人、钉钉企业内机器人、企业微信群机器人、飞书机器人、企业微信应用消息、邮箱、bark、webhook、Telegram机器人、Server酱、PushPlus、手机短信等。包括主动控制服务端与客户端,让你轻松远程发短信、查短信、查通话、查话簿、查电量等。(V3.0 新增)PS.这个APK主要是学习与自用,如有BUG请提ISSUE,同时欢迎大家提PR指正

KotlinBSD 2-Clause "Simplified" Licensesmsdingding
27.2k3.3k
logto-io/logto

🧑‍🚀 Authentication and authorization infrastructure for SaaS and AI apps, built on OIDC and OAuth 2.1 with multi-tenancy, SSO, and RBAC.

TypeScriptnpmMozilla Public License 2.0authenticationauthorization
logto.io
14.2k1k
howdyai/botkit

Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.

TypeScriptnpmMIT Licensebotkitbotkit-studio
11.6k2.2k
TheSpeedX/TBomb

This is a SMS And Call Bomber For Linux And Termux

PythonPyPIOthertermuxsms
5.5k1.9k
capcom6/android-sms-gateway

The SMS Gateway for Android™ app enables sending and receiving SMS messages through an API that can be accessed directly on the device or via a cloud server when direct device access is not possible.

KotlinApache License 2.0androidapi
docs.sms-gate.app
5.2k894
rememberber/WePush

专注批量推送的小而美的工具,目前支持:模板消息-公众号、模板消息-小程序、微信客服消息、微信企业号/企业微信消息、阿里云短信、阿里大于模板短信 、腾讯云短信、云片网短信、E-Mail、HTTP请求、钉钉、华为云短信、百度云短信、又拍云短信、七牛云短信

JavaMavenMIT Licensejavaswing
rememberber.github.io/WePush/
4.6k1k
moezbhatti/qksms

The most beautiful SMS messenger for Android

KotlinGNU General Public License v3.0androidkotlin
qklabs.com/download
4.6k1.1k
bhattsameer/Bombers

SMS/Email/Whatsapp/Twitter/Instagram bombers Collection :bomb::bomb::bomb: :boom: Also added collection of some Fake SMS utilities which helps in skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

PythonPyPIsmsemail-bomber
3.7k1.2k
typpo/textbelt

Free API for outgoing SMS

JavaScriptnpmMIT Licensesmssms-api
textbelt.com
3.4k580
overtrue/easy-sms

📲 一款多渠道的短信发送轮子

PHPPackagistMIT Licensesmssms-gateway
3.3k563
vernu/textbee

open-source sms-gateway. turn any android phone into an sms gateway

TypeScriptnpmMIT Licensegatewaysms
textbee.dev
3k409