Socket
Socket
Sign inDemoInstall

fimiproxy

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fimiproxy - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

32

build/src/proxy.js

@@ -25,3 +25,5 @@ "use strict";

node_console_1.default.error(error);
res.writeHead(500, node_http_1.STATUS_CODES[500], {}).end();
if (res.writable) {
res.writeHead(500, node_http_1.STATUS_CODES[500], {}).end();
}
});

@@ -32,2 +34,3 @@ res.on('error', error => {

node_console_1.default.error(error);
// TODO: if there's an error who ends res?
});

@@ -39,4 +42,6 @@ const host = (req.headers.host || '').toLowerCase();

if (!destination) {
res.writeHead(404, { 'Content-Type': 'text/plain' });
res.end(node_http_1.STATUS_CODES[404]);
if (res.writable) {
res.writeHead(404, { 'Content-Type': 'text/plain' });
res.end(node_http_1.STATUS_CODES[404]);
}
return;

@@ -64,4 +69,10 @@ }

const oReq = requestFn(options, oRes => {
res.writeHead(oRes.statusCode || 200, oRes.statusMessage, oRes.headers);
oRes.on('data', chunk => res.write(chunk));
if (res.writable) {
res.writeHead(oRes.statusCode || 200, oRes.statusMessage, oRes.headers);
}
oRes.on('data', chunk => {
if (res.writable) {
res.write(chunk);
}
});
oRes.on('end', () => res.end());

@@ -83,6 +94,13 @@ oRes.on('error', error => {

node_console_1.default.error(error);
res.writeHead(500, node_http_1.STATUS_CODES[500], {}).end();
if (res.writable) {
res.writeHead(500, node_http_1.STATUS_CODES[500], {}).end();
}
});
req.on('data', chunk => oReq.write(chunk));
req.on('data', chunk => {
if (oReq.writable) {
oReq.write(chunk);
}
});
req.on('end', () => oReq.end());
// TODO: what happens with oReq on req.on("error")
}

@@ -89,0 +107,0 @@ async function createHttpProxy() {

{
"name": "fimiproxy",
"version": "0.1.7",
"version": "0.1.8",
"description": "Simple HTTP and HTTPS reverse proxy",

@@ -42,7 +42,6 @@ "author": {

"fix": "gts fix",
"prepare": "npm run compile",
"pretest": "npm run compile",
"posttest": "npm run lint",
"publish-to-npm": "npm publish",
"show-packlist": "npm pack --dry-run"
"publish-to-npm": "npm run compile && npm publish",
"show-packlist": "npm run compile && npm pack --dry-run"
},

@@ -49,0 +48,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc