Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit 25d11a3

Browse files
committed
Updated the proxy to handle self-signed certificates and authentication
1 parent ce962b2 commit 25d11a3

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

digexp-sp-server/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,20 @@ exports.start = function start(dir, port) {
130130
console.log('server running at port ' + port + ' using root folder ' + dir);
131131

132132
app.get(/^\/wps\/proxy\/http/, function(req, resp) {
133-
var url = req.path.substring("/wps/proxy/".length);
133+
var url = req.url.substring("/wps/proxy/".length);
134134
url = url.replace(/^https?/, function(match) {
135135
return match + ":/";
136136
});
137-
request.get(url).pipe(resp);
137+
138+
// Including these headers sometimes gets 404 responses
139+
req.headers["referer"] = null;
140+
req.headers["host"] = null;
141+
142+
request.get({
143+
url: url,
144+
headers: req.headers,
145+
rejectUnauthorized: false
146+
}).pipe(resp);
138147
});
139148

140149
// Special processing for HTML and JS files

sp-server.tar.gz

105 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)