-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http2 is failing with #421
Comments
Not sure if this is the solution, but refactoring (
fastifyHeaders: FastifyRequest['headers'],
): Headers => {
const headers = new Headers();
for (const [key, value] of Object.entries(fastifyHeaders)) {
if (key.startsWith(':')) {
if (key === ':authority' && typeof value === 'string') {
headers.set('host', value);
}
continue;
}
if (Array.isArray(value)) {
for (const member of value) headers.append(key, member);
} else if (value) {
headers.append(key, value);
}
}
return headers;
}; |
wait jk, i got it by removing installGlobals oldwhat does your server look like? im not able to reproduce using the following import fs from "node:fs";
import process from "node:process";
import chalk from "chalk";
import { remixFastify } from "@mcansh/remix-fastify";
import { installGlobals } from "@remix-run/node";
import { fastify } from "fastify";
import sourceMapSupport from "source-map-support";
import getPort, { portNumbers } from "get-port";
installGlobals();
sourceMapSupport.install();
const app = fastify({
http2: true,
https: {
key: fs.readFileSync("server-key.pem"),
cert: fs.readFileSync("server-cert.pem"),
},
});
await app.register(remixFastify);
const host = process.env.HOST === "true" ? "0.0.0.0" : "127.0.0.1";
const desiredPort = Number(process.env.PORT) || 3000;
const portToUse = await getPort({
port: portNumbers(desiredPort, desiredPort + 100),
});
let address = await app.listen({ port: portToUse, host });
if (portToUse !== desiredPort) {
console.warn(
chalk.yellow(
`⚠️ Port ${desiredPort} is not available, using ${portToUse} instead.`,
),
);
}
console.log(chalk.green(`✅ app ready: ${address}`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I enable http2 in fastify, then the requests fail with the above error.
The text was updated successfully, but these errors were encountered: