Skip to content

HTTP2 Proxy always falls #51

Closed
Closed
@borodadada

Description

@borodadada

Hello, i fastify user, and now i needed proxy server, i install fastify proxy and set basic settings.
This my server -


const proxy = require('fastify-http-proxy')
const fastify = require('fastify')({
    logger: false,
    http2: true,
    https: {
        key: fs.readFileSync(path.join(serverDirectory, '/certificate/', 'key.pem')),
        cert: fs.readFileSync(path.join(serverDirectory, '/certificate/', 'domain.crt')),
        ca: [
            fs.readFileSync(path.join(serverDirectory, '/certificate/', 'USERTrustRSAAddTrustCA.crt')),
            fs.readFileSync(path.join(serverDirectory, '/certificate/', 'AddTrustExternalCARoot.crt')),
            fs.readFileSync(path.join(serverDirectory, '/certificate/', 'SectigoRSADomainValidationSecureServerCA.crt')),
        ]
    }
})

fastify.register(proxy, {
    upstream: 'https://localhost:3000',
    prefix: '/back', // optional
    http2: true // optional
})

I use SSL from domain, after request i use sort for several servers...
One problem, fastyfy proxy always falls!!!

Error

[nodemon] starting `node ./server/index.js`
internal/http2/compat.js:567
      throw new ERR_HTTP2_INVALID_STREAM();
      ^

Error [ERR_HTTP2_INVALID_STREAM]: The stream has been destroyed
    at Http2ServerResponse.writeHead (internal/http2/compat.js:567:13)
    at onSendEnd (D:\js\proxy\node_modules\fastify\lib\reply.js:308:7)
    at onSendHook (D:\js\proxy\node_modules\fastify\lib\reply.js:261:5)
    at handleError (D:\js\proxy\node_modules\fastify\lib\reply.js:418:5)
    at onErrorHook (D:\js\proxy\node_modules\fastify\lib\reply.js:373:5)
    at _Reply.Reply.send (D:\js\proxy\node_modules\fastify\lib\reply.js:98:5)
    at defaultErrorHandler (D:\js\proxy\node_modules\fastify\lib\context.js:34:9)
    at handleError (D:\js\proxy\node_modules\fastify\lib\reply.js:401:18)
    at onErrorHook (D:\js\proxy\node_modules\fastify\lib\reply.js:373:5)
    at _Reply.Reply.send (D:\js\proxy\node_modules\fastify\lib\reply.js:98:5)
[nodemon] app crashed - waiting for file changes before starting...

In version 1.* this same problem

  "dependencies": {
    "fastify": "^2.2.0",
    "fastify-http-proxy": "^2.1.0"
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions