We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.0.21
Alpine Linux v3.18 on Docker 4.30.0 ( Desktop ) on WSL version: 2.1.5.0 on Microsoft Windows NT 10.0.22631.0 x64
Alpine Linux v3.18
Docker 4.30.0 ( Desktop )
WSL version: 2.1.5.0
Microsoft Windows NT 10.0.22631.0 x64
when have cookie need to sign, socketAddress from requestIP will return will
socketAddress
requestIP
requestIP return normal socketAddress object
null
import { Elysia } from "elysia" const app = new Elysia({ name: "mainApp", serve: { hostname: "0.0.0.0", port: 8082, }, cookie: { sign: true, // If false requestIP return object of socketAddress secrets: process.env.COOKIE_KEY, }, }) .use((app) => app.derive(({ request }) => ({ ip: app.server?.requestIP(request)?.address, })), ) .derive({ as: "global" }, ({ cookie: { someMilk } }) => ({ get milkType() { const value = "chocolate milk" someMilk.set({ value: value, }) return value }, })) .get("/", ({ ip }) => { return ip + "some message" }) .listen({}, ({ development, hostname, port }) => { console.log( `🦊 Elysia is running at ${hostname}:${port} ${ development ? "🚧 in development mode!🚧" : "" }`, ) })
The text was updated successfully, but these errors were encountered:
Blocking on oven-sh/bun#6613
Sorry, something went wrong.
Fixed by Bun@1.1.27
import { Elysia } from "elysia"; const app = new Elysia({ name: "mainApp", serve: { port: 8082, }, cookie: { sign: true, // If false requestIP return object of socketAddress secrets: process.env.COOKIE_KEY || "ok", }, }) .use((app) => app.derive(({ request }) => ({ ip: app.server?.requestIP(request)?.address, })) ) .derive({ as: "global" }, ({ cookie: { someMilk } }) => ({ get milkType() { const value = "chocolate milk"; someMilk.set({ value: value, }); return value; }, })) .get("/", ({ ip }) => { return ip + "some message"; }) .listen({}, ({ development, hostname, port }) => { console.log( `🦊 Elysia is running at ${hostname}:${port} ${ development ? "🚧 in development mode!🚧" : "" }` ); });
Wait for testing.
No branches or pull requests
What version of Elysia.JS is running?
1.0.21
What platform is your computer?
Alpine Linux v3.18
onDocker 4.30.0 ( Desktop )
onWSL version: 2.1.5.0
onMicrosoft Windows NT 10.0.22631.0 x64
What steps can reproduce the bug?
when have cookie need to sign,
socketAddress
fromrequestIP
will return willWhat is the expected behavior?
requestIP return normal socketAddress object
What do you see instead?
null
Additional information
The text was updated successfully, but these errors were encountered: