Comments (10)
Add where? This library doesn't create the http server.
from node-http2-proxy.
These options are the options that the TLS client can pass in when creating a tls connection. You can see the nodejs documentation.
from node-http2-proxy.
I still don't see where in the api for this library you would like this? Can you provide an example on how you would like to use it?
from node-http2-proxy.
const tls = require('tls');
const fs = require('fs');
const options = {
// Necessary only if the server requires client certificate authentication.
key: fs.readFileSync('client-key.pem'),
cert: fs.readFileSync('client-cert.pem'),
// Necessary only if the server uses a self-signed certificate.
ca: [ fs.readFileSync('server-cert.pem') ],
rejectUnauthorized:false,
// Necessary only if the server's cert isn't for "localhost".
checkServerIdentity: () => { return null; },
};
const socket = tls.connect(8000, options, () => {})
from node-http2-proxy.
@masx200: that example has no relation to this library in its current form
from node-http2-proxy.
server.on('request', (req, res) => {
proxy.web(req, res, {
ca:[ fs.readFileSync('server-cert.pem') ],
rejectUnauthorized:false,
protocol:"https",
hostname: 'localhost'
port: 9000
}, defaultWebHandler)
})
from node-http2-proxy.
https://github.com/villadora/express-http-proxy#q-how-can-i-support-non-standard-certificate-chains
Q: How can I support non-standard certificate chains?
You can use the ability to decorate the proxy request prior to sending. See proxyReqOptDecorator for more details.
app.use('/', proxy('internalhost.example.com', {
proxyReqOptDecorator: function(proxyReqOpts, originalReq) {
proxyReqOpts.ca = [caCert, intermediaryCert]
return proxyReqOpts;
}
})
Q: How to ignore self-signed certificates ?
You can set the rejectUnauthorized value in proxy request options prior to sending. See proxyReqOptDecorator for more details.
app.use('/', proxy('internalhost.example.com', {
proxyReqOptDecorator: function(proxyReqOpts, originalReq) {
proxyReqOpts.rejectUnauthorized = false
return proxyReqOpts;
}
}))
from node-http2-proxy.
proxy.web(req, res, {
hostname: 'localhost'
port: 9000,
onReq: (req, options) => http.request(options)
}, defaultWebHandler)
from node-http2-proxy.
proxy.web(req, res, { hostname: 'localhost' port: 9000, onReq: (req, options) => http.request(options) }, defaultWebHandler)
Such use will make the novice very confused. Novices ca nāt find how to set options to support servers that use self-signed certificates.
from node-http2-proxy.
Such use will make the novice very confused. Novices ca nāt find how to set options to support servers that use self-signed certificates.
Sure, PR is welcome.
from node-http2-proxy.
Related Issues (20)
- Regex bug by choosing agent HOT 1
- onReq with finalhandler = Error HOT 5
- onReq param 2 (options) no longer the same thing in 5.x? HOT 2
- unknown difference between 4.2.15 and 5.0.13 HOT 7
- websockets don't proxy with 5.0.34 if the path isn't the same unless onReq is used HOT 2
- path: Target pathname. Defaults to req.originalUrl || req.url. HOT 1
- bug: onReq HOT 2
- Forwarding to unix socket HOT 4
- add typescript support HOT 3
- Adding "http2 to http2" proxy functions for proxy servers is now much easier. HOT 8
- add undici support
- Cluster support (Bug??) HOT 17
- Possible wrong type for onReq HOT 3
- Issue with custom response streams handler HOT 2
- unable to proxy http2 request
- Connection upgrade support only websocket HOT 1
- secure: false HOT 2
- dear sir ,http2 bug & please update your doc
- websocket proxy not completing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-http2-proxy.