This app used the Nexmo SMS API to demonstrate how to use build an SMS proxy for masked communication between users.
You will need:
- A free Nexmo account
- Somewhere to host this web app, Heroku or Your Local Machine with ngrok both work well
git clone https://github.com/nexmo/node-sms-proxy.git
cd node-sms-proxy
npm install
Rename the config file:
mv example.env .env
Fill in the values in .env
as appropriate.
If preferred you can set previously provisioned numbers in the PROVISIONED_NUMBERS
configuration value.
npm start
The application should be available on http://localhost:5000.
If you have not set up predefined numbers you can access http://localhost:5000/provision for the application to provision numbers.
Register a conversation with the application so that mappings can be created between real user numbers and Nexmo virtual numbers. This is done by making a POST
such as the following to http://localhost:5000/conversation:
POST /conversation HTTP/1.1
Host: localhost:5000
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
userANumber=USER_A_NUMBER&userBNumber=USER_B_NUMBER
When you do this each of the users will receive a text. Reply to that text will allow the to communicate anonymously with each other.
You can see a list of registered conversations by accessing http://localhost:5000/conversations.