http2 - compat not working as http
I've got a weird case where http & https works without problem. However, http2 compat does not.
In the case where I'm trying to do a PATCH, PUT or POST the request doesn't finish with http2. GET, HEAD and other "safe" methods work without problem.
Given that http2 compat should be mostly an in place replacement for http I believe this is a bug somewhere?
I'm basically using http2-proxy something like:
const http2 = require('http2') const proxy = require('http2-proxy') const http = require('http') const fs = require('fs') const proxyServer = http2 .createSecureServer({ cert: fs.readFileSync('./server.crt'), key: fs.readFileSync('./server.key'), allowHTTP1: true }) .on('request', (req, res) => { proxy.web(req, res, { hostname: 'localhost', port: 7000 }, err => { if (err) { console.error('proxy error', err) } }) }) .listen(6000) const server = http .createServer() .on('request', (req, res) => { req .pipe(fs.createWriteStream(Math.random().toString())) .on('finish', () => { res.statusCode = 200 res.end() }) }) .listen(7000)
Can't create a full repo since I don't know how to do http2 requests in node.