Skip to content

Passing port to Backend.target results in NetworkError? #1496

Description

@zkat

The following results in a NetworkError/HTTP Protocol Error for me:

import { Backend } from "fastly:backend";

addEventListener("fetch", (event: FetchEvent) =>
  event.respondWith(handleRequest(event)),
);

async function handleRequest(event: FetchEvent): Promise<Response> {
  const backend = new Backend({
    name: "fastly",
    target: "www.fastly.com:443",
  });
  try {
    const res = await fetch("https://www.fastly.com", {
      backend,
    });
    return new Response("ok");
  } catch (e) {
    console.log("GOT ERR:", e.code, e.name, e.message);
    return new Response("nope");
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions