typpo / textbelt

Free API for outgoing SMS
https://textbelt.com/
MIT License
3.01k stars 508 forks source link

Trouble using with SSL #151

Closed mscroggs2017 closed 4 years ago

mscroggs2017 commented 4 years ago

When I run the following code I get a mixed content error because the site this code is running from is HTTPS and it is sending to HTTP.

$.ajax({ type: "POST", url: "http://mysite.com:9090/text", data: { number: n, message: message },

When I replace the http with https to combat the mixed content error, I get net::ERR_SSL_PROTOCOL_ERROR. When searching the code I can't find anything that could be the issue.

Really scratching my head on this one. Any help is appreciated.

typpo commented 4 years ago

Hi @mscroggs2017,

The Textbelt server is just a node server and doesn't have SSL built in. To protect your connections, I suggest terminating SSL in front of it using nginx or another web server as a reverse proxy.

This tutorial may help you get started.

mscroggs2017 commented 4 years ago

Thank you for the quick response. I will give this a try.