https-proxy-server-express
Advanced tools
Comparing version 0.1.0 to 0.1.1
/// <reference types="node" /> | ||
import { ServerOptions as HttpsServerOptions } from 'https'; | ||
import { ServerOptions as HttpsServerOptions } from "https"; | ||
export declare class ProxyServer { | ||
@@ -4,0 +4,0 @@ private app; |
@@ -27,10 +27,10 @@ "use strict"; | ||
const clientCertAuth = (req, res, next) => { | ||
console.log('Client certificate authentication in progress...'); | ||
const clientCert = req.socket.getPeerCertificate(); | ||
if (!clientCert) { | ||
return res.status(401).send('No client certificate provided.'); | ||
return res.status(401).send("No client certificate provided."); | ||
} | ||
console.log('Client certificate', clientCert); | ||
if (!req.socket.authorized) { | ||
return res.status(401).send('Invalid client certificate authentication.'); | ||
return res | ||
.status(401) | ||
.send("Invalid client certificate authentication."); | ||
} | ||
@@ -46,8 +46,10 @@ next(); | ||
changeOrigin: true, | ||
secure: false | ||
secure: false, | ||
}; | ||
this.app.use('/', (0, http_proxy_middleware_1.createProxyMiddleware)(proxyOptions)); | ||
this.app.use("/", (0, http_proxy_middleware_1.createProxyMiddleware)(proxyOptions)); | ||
} | ||
start() { | ||
this.server = https_1.default.createServer(this.options, this.app).listen(this.port, () => { | ||
this.server = https_1.default | ||
.createServer(this.options, this.app) | ||
.listen(this.port, () => { | ||
console.log(`Server is running on port ${this.port}`); | ||
@@ -54,0 +56,0 @@ }); |
{ | ||
"name": "https-proxy-server-express", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78
2894