pixl-server-web 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/lib/http.js +2 -1
- package/lib/https.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -789,6 +789,19 @@ Note that these are matched using logical OR, so only one of them needs to match
|
|
|
789
789
|
|
|
790
790
|
This sets the idle socket timeout for all incoming HTTPS requests. If omitted, the Node.js default is 2 minutes. Please specify your value in seconds.
|
|
791
791
|
|
|
792
|
+
## https_bind_address
|
|
793
|
+
|
|
794
|
+
Optionally specify an exact local IP address to bind the HTTPS listener to. By default this uses the value of [http_bind_address](#http_bind_address), but you can bind them differently using this property. Example:
|
|
795
|
+
|
|
796
|
+
```json
|
|
797
|
+
{
|
|
798
|
+
"http_bind_address": "127.0.0.1",
|
|
799
|
+
"https_bind_address": "0.0.0.0"
|
|
800
|
+
}
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
This example would cause the server to only listen on localhost for plain HTTP traffic, but listen on *all* network interfaces for HTTPS traffic.
|
|
804
|
+
|
|
792
805
|
# Custom URI Handlers
|
|
793
806
|
|
|
794
807
|
You can attach your own handler methods for intercepting and responding to certain incoming URIs. So for example, instead of the URI `/api/add_user` looking for a static file on disk, you can have the web server invoke your own function for handling it, and sending a custom response.
|
package/lib/http.js
CHANGED
|
@@ -208,7 +208,8 @@ module.exports = class HTTP {
|
|
|
208
208
|
|
|
209
209
|
// do not try to write to socket if already closed
|
|
210
210
|
if ((err.code != 'ECONNRESET') && socket.writable) {
|
|
211
|
-
|
|
211
|
+
if (err.code == 'HPE_INVALID_METHOD') socket.destroy();
|
|
212
|
+
else socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
|
|
212
213
|
}
|
|
213
214
|
socket._pixl_data.aborted = true;
|
|
214
215
|
|
package/lib/https.js
CHANGED
|
@@ -206,7 +206,8 @@ module.exports = class HTTP2 {
|
|
|
206
206
|
|
|
207
207
|
// do not try to write to socket if already closed
|
|
208
208
|
if ((err.code != 'ECONNRESET') && socket.writable) {
|
|
209
|
-
|
|
209
|
+
if (err.code == 'HPE_INVALID_METHOD') socket.destroy();
|
|
210
|
+
else socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
|
|
210
211
|
}
|
|
211
212
|
socket._pixl_data.aborted = true;
|
|
212
213
|
|
package/package.json
CHANGED