Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

142
Vistas
Is there an easy way to get the IP client using Deno.serveHttp?

I found this issue on the official repository. But instead of an straight way is more an implementation from oakserver. https://github.com/denoland/deno/discussions/9314

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can cast the connection's address as a Deno.NetAddr and access the hostname (and port if you want) there:

const server = Deno.listen({ port: 8080 });

for await (const conn of server) {
  (async () => {
    const httpConn = Deno.serveHttp(conn);
    const { hostname } = conn.remoteAddr as Deno.NetAddr;
    for await (const requestEvent of httpConn) {
      requestEvent.respondWith(new Response(hostname));
    }
  })();
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda