Thanks to visit codestin.com
Credit goes to github.com

Skip to content

xxRockOnxx/bun-h3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

This contains reproduction for a weird behavior between H3 proxyRequest and Bun.

Execution Path

(Caddy | Nginx) > Bun (runtime) > H3 (server code)

Local Endpoints

minimal Caddyfile and NGINX config are also included to make it easier to reproduce.

Then just add these in your /etc/hosts file:

127.0.0.1 bun.test
127.0.0.1 node.test

Observed Behavior

When requests pass through Caddy or NGINX to Bun/H3 using proxyRequest, H3 successfully fetches the upstream response, but the reverse proxy still returns 502.

Direct access to the underlying applications returns the correct response.

Request Expected Actual
http://bun.test 200 200
http://node.test 200 200 (For some reason)
http://bun.test/200 200 200
http://node.test/200 200 502 via Caddy; hangs indefinitely via NGINX
http://localhost:3001/200 200 200
http://localhost:3002/200 200 200

This only happens in proxyRequest. If you actually set the response yourself like setResponseStatus(event, 401), it still works.

Regards to actual command ran in the docker-compose.yml, you can remove --bun flag on the node but it still won't work.

Nuxt

This especially confusing on Nuxt app when Bun runtime is used but bun preset is not set in nuxt.config.

export default defineNuxtConfig({
  // .....

  nitro: {
    preset: "bun",
  },
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published