D
Deno

help

How to get remote IP address when using Deno.serve?

Ffrigjord2/5/2023
I'm using connInfo when using Deno from STD but the native http server doesn't seem to have such interface, since it's undefined via the handler.
CcrowlKats2/5/2023
currently not possible
CcrowlKats2/5/2023
GitHub
feat(flash): add 2nd param to handler to get remote address by crow...
Closes #17583 Not a big fan of it being a function, but couldnt think of a better solution without potential performance regressions
Ffrigjord2/27/2023
Thanks for making such a PR; I hope someone can approve it soon deno as a proxy is useless without this The PR has been implemented now and can be accessed like this:
async function handler (request, connInfo) {
console.log(connInfo.remoteAddr.hostname)
}
async function handler (request, connInfo) {
console.log(connInfo.remoteAddr.hostname)
}

Looking for more? Join the community!

Recommended Posts
Two questions on documentationRTFM in 3... 2... 🙂 Question 1: How do i hide documentation for specific exports, i do not want Is there any simple way to keep track of the heap/stack usage of a running Deno application?I have made a Deno application and I'm curious to know if there's heap/stack issues that I should fiusing data from one deno bench in anotheris there any good way to re-use the results generated in one deno bench in another one? example: `docker compose up of Oak server throws: SyntaxError: Duplicate export of 'type'I am just learning how to use Docker, and am trying to put up a container of an Oak server. When runPublishing Deno Module with Bin (Answered)I know there's a way to include a `bin/` when publishing a module and then perform some kind of `denUse local tgz file instead of tgz from npm registryHello, Is it possible to reference a local tgz file inside a deno project (like calling `npm instalvscode LSP being a disgraceful little bitchfor no reason obvious to me, vscode and deno's lsp has been acting up lately. any ideas what could bIs there a way to fetch() with headers, WITHOUT forcing header keys to lowercase?Title. I'm trying to create an API wrapper for a service which uses "Incapsula" as their firewall orHow do I use std/log?I'm trying to create a log file. I don't seem to be able to make it work tho. ```ts import { handleop_ffi_cstr_read replacement now that deno.core.ops is gone?The latest release removed Deno.core.ops, which a library of mine relied on to use `op_ffi_cstr_readNPM Import results in Rust panicLooking to import the Airgram NPM package because I don't want to write it from scratch at this momeDeno fmt conflicting with Deno lint, when using IIFE```ts // before formating ((): void => { /* code */ })() ``` after formating with deno fmt, it adds