-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Textbelt Standalone Windows Error #78
Comments
Two things:
|
This might be a good starting point for iisnode deployment (of textbelt): https://tomasz.janczuk.org/2011/08/hosting-express-nodejs-applications-in.html It would seem you don't have to start anything on the command line, e.g. node server\app.js once configured correctly for iisnode per that tutorial, you just access with a REST client (browser based REST client or using code) to make an HTTP POST to with Content-Type header set to application/x-www-form-urlencoded and sending the phone number and text messages as form POST key/value pairs in the request body. The port may not be 9090 if you've configured it differently in IIS/iisnode/Windows, so it might be 80 (in which case you can leave out the port number) or 8080 for example. You could explicitly set it for 9090, best not to leave it undefined and let textbelt try to default to 9090. Also per that tutorial, you have to set up URL rewrite rule for textbelt so that IIS forwards the REST URLs to textbelt to handle. And relating to that, you might have to modify the REST API paths in server\app.js depending on how you've hosted it in IIS, e.g. edit lines 75, 81, 86, 99, 103, the app.get/post entries) Let us know how things go. Would be good to have a writeup for others on how to get textbelt working under IIS with iisnode. |
Hi warren8r, The torlist error is safe to ignore. It's meant to be informative, and I should make that clearer in the code. The presence of a torlist file is optional. I think the EPIPE error happens when the pipe from Textbelt to the mailer is interrupted. It seems related to this issue: nodejs/node-v0.x-archive#3211 Try including one of the suggested solutions at the top of your app: https://github.com/mhart/epipebomb and see if that changes anything? |
Hello typpo, |
Update: I have added an empty torlist file to the server folder and that has resolved the expected 'banned ips' parameter. No more ENOENT error. |
The issue here is most likely that Textbelt depends on Mutt is an email client. According to the mutt website, there is a windows version: http://www.mutt.org/download.html |
Thank you so much, typpo! |
Hey warren8r, sorry for the delay. The SMS get sent by a mail client directly to the email gateway of all providers. For example, you can text a Verizon number by emailing [email protected]. When you send a text to 9876543210 via Textbelt, it tells mutt to send an email to vtext.com with your message. So as you can see, unfortunately, the mail client is a critical dependency! |
@typpo No worries! |
Curious @typpo, why do we use mutt if textbelt is node.js based? I believe any node.js email client (library) can send the email instead of relying on mutt. I myself use the emailjs module to send out emails. Using a node.js email client/library allows you to self contain the dependency with node/npm rather than having to externally have mutt preconfigured/installed on one's textbelt server. Or is it a matter of scale with mutt being performant in sending many emails? |
@warren8r Textbelt originally used sendmail. You and @daluu are absolutely right that this would make more sense. I was running into weird issues where providers blocked Textbelt email, which brought the service down from time to time. You can still see there are a couple issues open that are related to this. I noticed that mutt solved this problem. I looked into the headers and tried to match them 1-to-1 in sendmail/mail, but still had trouble for some reason. So, I decided to just switch to mutt because the vast majority of usage (as far as I know) is through textbelt.com rather than self-hosting, so it made sense to fix textbelt.com ASAP. It would certainly be possible to revert to the old There's probably some email client library for node that will work. emailjs has an smtp server dependency though. Textbelt send mail itself rather than going through an smtp server. This is because the amount of emails/texts Textbelt sends per day would be considered abusive by any public smtp server. |
Nice! Rate limiting info is stored in redis. You can go into your redis db using |
I have installed TextBelt on IIS (using iisnode) Windows Server 2012 platform. I have followed the instructions on https://github.com/typpo/textbelt for standalone. When I try to run the service using:
node server\app.js
I get the following response:
C:\Program Files\iisnode\www\textbelt>node server\app.js
{ Error: ENOENT: no such file or directory, open 'C:\Program Files\iisnode\www\textbelt\server\torlist' ``at Error (native)
at Object.fs.openSync (fs.js:634:18)
at Object.fs.readFileSync (fs.js:502:33)
at Object.<anonymous> (C:\Program Files\iisnode\www\textbelt\server\app.js:42:24)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Function.Module.runMain (module.js:575:10)
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Program Files\\iisnode\\www\\textbelt\\server\\torlist' }
Listening on 9090
Since it says it is "Listening" I try to access the service to send a message and Visual Studio debug says:
The underlying connection was closed: An unexpected error occurred on a receive.
And then I get the following information in the log:
txting phone 5556567898 : Hello, World! ``Hello, World!
events.js:160
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at exports._errnoException (util.js:949:11)
at Socket._writeGeneric (net.js:705:26)
at Socket._write (net.js:724:8)
at doWrite (_stream_writable.js:307:12)
at writeOrBuffer (_stream_writable.js:293:5)
[at Socket.Writable.write (_stream_writable.js:220:11)](url)
at Socket.write (net.js:650:40)
at Object.sendText [as send] (C:\Program Files\iisnode\www\textbelt\lib\text.js:83:15)
at doSendText (C:\Program Files\iisnode\www\textbelt\server\app.js:166:10)
at Command.callback (C:\Program Files\iisnode\www\textbelt\server\app.js:240:7)
I am not sure if this is due to the first failure when running the service or if this is an IIS issue (some simple permissions thing I am not doing). I have opened the port in Windows Firewall for both the service and Redis. Any help would be greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered: