Git Product home page Git Product logo

Comments (7)

mmastrac avatar mmastrac commented on May 28, 2024

@marvinhagemeister is this Linux or Mac? It looks like the socket address is being resolved here which is a bit strange.

from deno.

marvinhagemeister avatar marvinhagemeister commented on May 28, 2024

@mmastrac I'm on macOS

from deno.

marvinhagemeister avatar marvinhagemeister commented on May 28, 2024

Turns out that the issue can be reproduced with Deno.serve alone:

Deno.serve({ hostname: "localhost" }, () => new Response("foo"));

Output:

$ deno run -A foo.ts
Listening on http://::1:8000/

from deno.

mmastrac avatar mmastrac commented on May 28, 2024

@marvinhagemeister What do you have in /etc/hosts (cat /etc/hosts | grep "localhost")? Also, do you have IPv6 configured under your network settings?

I wonder if this is a weird IPv6 resolution thing.

from deno.

marvinhagemeister avatar marvinhagemeister commented on May 28, 2024

The default host file on macOS looks like this:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255	broadcasthost
::1             localhost

from deno.

dsherret avatar dsherret commented on May 28, 2024

Just ran into this on Windows. In v1.42.3 it prints localhost and in 1.43.1 it prints "::1"

Deno.serve({
  hostname: "localhost",
  onListen(details) {
    console.log(details);
  },
}, (request) => {
  return new Response(null);
})

from deno.

dsherret avatar dsherret commented on May 28, 2024

It also occurs on Linux and Mac: https://github.com/dsherret/dax/actions/runs/8951547585/job/24587971522

from deno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.