Comments (7)
This line seems to be the issue: https://github.com/honojs/node-server/blob/main/src/request.ts#L120 The request shim has the HTTP protocol hard coded.
from node-server.
Hi @hilja Thanks for creating the issue.
Hi @seep Thanks for the reference info.
Indeed, when using 'node:http2' or 'node:https', it certainly looks better to be https:
. I will create a PR for the change.
As for the x-forwarded-proto, I think it should be handled on the application side. Or if there are a lot of requests, we could provide a hook point that can be rewritten. Anyway, I think it is better not to handle x-forwarded-proto implicitly.
from node-server.
Any luck on that one ? I have the same issue
from node-server.
We're seeing this as well with https.createServer
.
from node-server.
@hilja Thanks for raising the issue.
Hi @usualoma , as @seep mentioned, I think we can fix the line. Can you take a look?
from node-server.
If it helps, I was able to work around this by pulling the IncomingMessage
object out of the request and checking incoming.socket.encrypted
. I think you can do the same here for the fix. When using https.createServer
the socket will be an instance of tls.TLSSocket
instead of net.Socket
. For reference: https://nodejs.org/api/tls.html#tlssocketencrypted
from node-server.
Created #155
from node-server.
Related Issues (20)
- serveStatic isn't working HOT 2
- TypeError: headers is not iterable HOT 2
- Proxy is not working HOT 2
- Make Original `IncomingMessage` and `ServerResponse` Publicly Accessible
- Security vulnerability with serveStatic HOT 5
- Support compression gzip and deflate
- Vercel node issue: Cannot find module HOT 1
- Unified access to environment variables? HOT 3
- should use `writeFromReadableStream()` for a `ReadableStream` HOT 1
- `app.mount()` is not working with `@hono/node-server` HOT 2
- TypeError: Cannot read private member #body from an object whose class did not declare it HOT 5
- SSE events not being output to clients HOT 1
- How to deal with `ERR_HTTP_HEADERS_SENT` errors? HOT 1
- Optimisations breaking `instanceof Response` checks HOT 6
- TypeError: Class extends value undefined is not a constructor or null
- Denial of Service in newRequest HOT 10
- Determine behaviour for HTTP1.0 request w/o Host header
- Return 400 or 500 if the Host header contains a path. HOT 1
- GET request -> c.req.body returns ReadableStream HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-server.