Unable to open local docker service

Brave version

Version 0.56.15 Chromium: 70.0.3538.110 (Official Build) (64-bit)

While following the docker tutorial here (https://docs.docker.com/get-started/part3/#run-your-new-load-balanced-app), one of steps creates a self-hosted load-balanced application available at localhost:4000.

docker stack deploy -c docker-compose.yml getstartedlab

docker-compose.yml:

version: "3"
services:
  web:
    image: madumlao/get-started:part2
    deploy:
      replicas: 5
      resources:
        limits:
          cpus: "0.1"
          memory: 50M
      restart_policy:
        condition: on-failure
    ports:
      - "4000:80"
    networks:
      - webnet
networks:
  webnet:

This loads 5 instances of a public docker image and load-balances port 4000 across their port 80.

The instances respond to curl correctly:

madumlao@lezard ~ $ curl localhost:4000
<h3>Hello World!</h3><b>Hostname:</b> dbe07af23505<br /><b>Visits:</b> <i>cannot connect to Redis, counter disabled</i>

madumlao@lezard ~ $ curl localhost:4000
<h3>Hello World!</h3><b>Hostname:</b> 0172703fe822<br /><b>Visits:</b> <i>cannot connect to Redis, counter disabled</i>

madumlao@lezard ~ $ curl localhost:4000
<h3>Hello World!</h3><b>Hostname:</b> 4f5250d39d58<br /><b>Visits:</b> <i>cannot connect to Redis, counter disabled</i>

madumlao@lezard ~ $ curl localhost:4000
<h3>Hello World!</h3><b>Hostname:</b> 01e1d26ff663<br /><b>Visits:</b> <i>cannot connect to Redis, counter disabled</i>

madumlao@lezard ~ $ curl localhost:4000
<h3>Hello World!</h3><b>Hostname:</b> 1139d0f475fb<br /><b>Visits:</b> <i>cannot connect to Redis, counter disabled</i>

madumlao@lezard ~ $ curl localhost:4000
<h3>Hello World!</h3><b>Hostname:</b> dbe07af23505<br /><b>Visits:</b> <i>cannot connect to Redis, counter disabled</i>

However, nothing loads in brave if I type localhost:4000 in the browser.

It’s perpetually stuck at Waiting for localhost…

I’ve foreced shields off on localhost but no effect.

Firefox seems to load the page just fine.

However I noticed that google chrome (70.0.3538.110-1) and iridium (2018.11.71-1iridium0) appear to have the same problem.

I figure it’s some kind of aggressive caching thing, but I wouldn’t know what settings (if any) to tweak to disable that for localhost or other development sites. Would you know?

Its likely a chromium issue (given what you said about it not working in Chrome or Iridium). Just to check, did you also disable Shields globally when you tried this? We’ve had some issues where domain-specific Shields are turned off but Global Shields settings (for some reason) sometimes still continue to block content/connections.

Try disabling Shields globally and see if that works.

After quite a bit of checking it does appear to be a chrome issue.

Chrome stupidly does not respect system settings with respect to localhost. Localhost is always forced to be the ipv6 localhost (::6) regardless of what you configure in /etc/gai.conf, /etc/hosts, /etc/nsswitch.conf, etc. It FORCES ipv6 on me even when I EXPLICITLY configure my system to use ipv4.

All other browsers and user agents respect my settings in /etc/gai.conf and /etc/hosts to set localhost to the ipv4 localhost (127.0.0.1). Can this be done for brave?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.