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

BACKHOST does not work properly #1

Open
PoneyClairDeLune opened this issue Jul 20, 2022 · 4 comments
Open

BACKHOST does not work properly #1

PoneyClairDeLune opened this issue Jul 20, 2022 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@PoneyClairDeLune
Copy link
Collaborator

Thanks to denoland/deno#11017, Deno effectively disabled all domain fronting attempts. Apparently Deno's coreteam considers server-side code as users. A modified fetch implementation might be required to bypass this restriction.

Cloudflare Workers also disabled domain fronting via workers.

@PoneyClairDeLune PoneyClairDeLune added bug Something isn't working help wanted Extra attention is needed labels Jul 20, 2022
@LucienLeMagicien
Copy link

Hello! I've been following that issue too, and saw the backlink to this issue a while ago so I thought I'd chime in! Deno recently (as of v1.36) merged a way to send Host headers via the Deno.createHttpClient. See the test case here:
https://github.com/denoland/deno/blob/5cb1d18439f562c8004a941b0f56ed034a44b052/cli/tests/unit/fetch_test.ts#L1572-L1589

   const client = Deno.createHttpClient({ 
       allowHost: true, 
     }); 
     const res = await fetch("http://localhost:4545/echo_server", { 
       headers: { 
         "host": "example.com", 
       }, 
       client, 
     }); 

(Note that you need to run deno with --unstable to have access to Deno.createHttpClient)

@PoneyClairDeLune
Copy link
Collaborator Author

@LucienLeMagicien Many thanks for chiming in! I was almost starting to look to port adobe/fetch to Deno... Work relieved!

@LucienLeMagicien
Copy link

My pleasure! It seems you're not aware of this either (since you were looking at reimplementing a module), so just so you know: Deno can now also use npm modules directly, and the "Node.js compatibility layer" is pretty good (and they track compatibility issues in their issues). Since v1.28 (https://deno.com/blog/v1.28) you can do things like import axios from "npm:axios" or import nodefetch from "npm:node-fetch".

(The Host header also didn't work when doing this at first, but they fixed it (in v1.34) after I opened an issue 👌)

@PoneyClairDeLune
Copy link
Collaborator Author

PoneyClairDeLune commented Sep 8, 2023

@LucienLeMagicien I was seeking to re-implement because I wanted it to be either runtime-native or runtime-agnostic.
Tbh I hate Node.js and it's ecosystem, and I've been a vocal opposer for Deno to add direct Node.js compatibilities. I wish for a runtime complying with mutually agreed-upon standards, not one adding it's own sauces to do nearly everything.
Still, thanks for pointing it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants