Skip to content
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

fetch() from localhost does not work #555

Open
chrisfarber opened this issue Jun 8, 2023 · 0 comments
Open

fetch() from localhost does not work #555

chrisfarber opened this issue Jun 8, 2023 · 0 comments

Comments

@chrisfarber
Copy link

Attempts to fetch() from localhost (when running inside Viceroy, with dynamic backends enabled in the application) result in errors.

For example, running this code:

fetch("http://localhost:4200/index.html");

Will result in these errors printed to the Viceroy console:

Error: hyper::Error(Connect, Custom { kind: InvalidData, error: CorruptMessage })
2023-06-07T20:15:10.852817Z ERROR request{id=0}: Hostcall yielded an error: error trying to connect: received corrupt message
Log: (new Error("NetworkError when attempting to fetch resource.", ""))

It appears as though it's attempting to negotiate SSL. Note that the following program does work:

/// <reference types="@fastly/js-compute" />

import { allowDynamicBackends } from "fastly:experimental";

allowDynamicBackends(true);

addEventListener("fetch", event => event.respondWith(fetch('http://innerastoundingmajesticlight.neverssl.com/online/')));

A Rust compute@edge app running in Viceroy can successfully uses localhost + an arbitrary port as a dynamic backend, suggesting this problem exists in our JS runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant