loop-server-fast
Advanced tools
Comparing version 0.5.8 to 0.5.10
@@ -506,3 +506,5 @@ #!/usr/bin/env node | ||
var cookies = parseCookies(req); | ||
params.sessionId = cookies.PHPSESSID; //This is our custom cookie. | ||
if(!params.sessionId) { //Only if not passed in on the command line | ||
params.sessionId = cookies.PHPSESSID; //This is our custom cookie. | ||
} | ||
if(!params.sessionId) { | ||
@@ -509,0 +511,0 @@ res.statusCode = 400; //Error - tell the app about it |
@@ -5,3 +5,3 @@ { | ||
"description": "A faster NodeJS reader to complement the AtomJump Loop Server.", | ||
"version": "0.5.8", | ||
"version": "0.5.10", | ||
"bin": { | ||
@@ -8,0 +8,0 @@ "loop-server-fast": "bin/loop-server-fast.js" |
@@ -14,3 +14,3 @@ <img src="https://atomjump.com/images/logo80.png"> | ||
* NodeJS >= 4.x | ||
* AtomJump Loop Server >= 0.5.22 | ||
* AtomJump Loop Server >= 1.5.5 | ||
* Linux server (or any machine with NodeJS) | ||
@@ -38,3 +38,4 @@ | ||
... | ||
"readPort" : "3277", [you can choose a port number here] | ||
"readPort" : 3277, [can be a different port] | ||
"readURL" : "http://yoururl.com:3277", [for wider compatiblity you should use a standard port URL that points at this port. See 'Ports' section below] | ||
"httpsKey" : "/path/to/your/https.key", [optional, for https only] | ||
@@ -81,3 +82,4 @@ "httpsCert": "/path/to/your/https.crt", [optional, for https only] | ||
... | ||
"readPort" : "3277", [you can choose a port number here] | ||
"readPort" : 3277 [can be a different port] | ||
"readURL" : "http://yoururl.com:3277", [for wider compatiblity you should use a standard port URL that points at this port. See 'Ports' section below] | ||
"httpsKey" : "/path/to/your/https.key", [optional, for https only] | ||
@@ -102,3 +104,43 @@ "httpsCert": "/path/to/your/https.crt", [optional, for https only] | ||
# Ports | ||
If you use a non-standard port number in a URL e.g. 3277, some machines behind proxy servers, particularly corporates, or some public PCs may filter the URL out when trying to read from it. The best practice here is to use the standard port 80 for http and 443 for https. Alternatively, if this port is not available on the machine you are using (for example, typically Apache would be using both already for the Loop Server), you can also either use an .htaccess redirect in the Apache settings, or a load balancer address rewiring in a load balancer from, say, a subdomain. | ||
An .htaccess redirect might look something like this: | ||
``` | ||
RewriteRule ^loop-server-fast$ http://mycompany.com:3277 [L,PT] | ||
``` | ||
A subdomain switcher within haproxy load balancer might do this: | ||
``` | ||
INPUT: https://loop-server-fast.mycompany.com [note: uses standard port 443] | ||
CONVERT TO: https://mycompany.com:3277 | ||
``` | ||
with a command like this: | ||
``` | ||
frontend https-in | ||
#Standard https in | ||
bind *:443 | ||
option tcplog | ||
mode tcp | ||
tcp-request inspect-delay 5s | ||
tcp-request content accept if { req_ssl_hello_type 1 } | ||
#Search for the subdomain to redirect | ||
use_backend loop-server-fast if { req_ssl_sni -i loop-server-fast.mycompany.com } | ||
default_backend loop-server | ||
backend loop-server-fast | ||
mode tcp | ||
balance leastconn | ||
option ssl-hello-chk | ||
#Redirect to the precise server ip and the loop-server-fast's port (3277) | ||
server node-loop-server-fast 12.34.56.23:3277 check | ||
``` | ||
# Troubleshooting | ||
@@ -105,0 +147,0 @@ |
35323
718
175