Code Monkey home page Code Monkey logo

Comments (8)

pawelmalak avatar pawelmalak commented on June 23, 2024 1

So I setup reverse proxy using NginxProxyManager and got the same error on all major browsers.
As expected, the error was caused by use of ws:// protocol with https://.

I've added simple check on WeatherWidget which will connect to either ws or wss based on document.location.protocol so it can be used both in development and on production.

I don't know how it works with other reverse proxy services but here I had to allow for websocket support to get it fully working.

from flame.

pawelmalak avatar pawelmalak commented on June 23, 2024

Are you getting any errors in the console?

from flame.

maeries avatar maeries commented on June 23, 2024

I started the container 6 now.

Twice I got

~/docker/flame$ docker-compose up
Creating flame_flame_1 ... done
Attaching to flame_flame_1
flame_1  | Socket: listen
flame_1  | Server is running on port 5005 in production mode
flame_1  | Connected to database
flame_1  | All models were synced
flame_1  | Initial config created
^CGracefully stopping... (press Ctrl+C again to force)
Stopping flame_flame_1 ... done

Three times I got

~/docker/flame$ docker-compose up
Creating flame_flame_1 ... done
Attaching to flame_flame_1
flame_1  | Socket: listen
flame_1  | Server is running on port 5005 in production mode
flame_1  | Connected to database
flame_1  | All models were synced
flame_1  | Initial config created
flame_1  | External API request failed
^CGracefully stopping... (press Ctrl+C again to force)
Stopping flame_flame_1 ... done

And once I got

~/docker/flame$ docker-compose up
Starting flame_flame_1 ... done
Attaching to flame_flame_1
flame_1  | Socket: listen
flame_1  | Server is running on port 5005 in production mode
flame_1  | Connected to database
flame_1  | {
flame_1  |   name: 'SequelizeEagerLoadingError',
flame_1  |   message: 'Bookmark is not associated to Category!'
flame_1  | }
flame_1  | SequelizeEagerLoadingError: Bookmark is not associated to Category!
flame_1  | {
flame_1  |   name: 'SequelizeEagerLoadingError',
flame_1  |   message: 'Bookmark is not associated to Category!'
flame_1  | }
flame_1  | SequelizeEagerLoadingError: Bookmark is not associated to Category!
flame_1  | {
flame_1  |   name: 'SequelizeEagerLoadingError',
flame_1  |   message: 'Bookmark is not associated to Category!'
flame_1  | }
flame_1  | SequelizeEagerLoadingError: Bookmark is not associated to Category!
flame_1  | {
flame_1  |   name: 'SequelizeEagerLoadingError',
flame_1  |   message: 'Bookmark is not associated to Category!'
flame_1  | }
flame_1  | SequelizeEagerLoadingError: Bookmark is not associated to Category!
flame_1  | {
flame_1  |   name: 'SequelizeEagerLoadingError',
flame_1  |   message: 'Bookmark is not associated to Category!'
flame_1  | }
flame_1  | SequelizeEagerLoadingError: Bookmark is not associated to Category!
flame_1  | {
flame_1  |   name: 'SequelizeEagerLoadingError',
flame_1  |   message: 'Bookmark is not associated to Category!'
flame_1  | }
flame_1  | SequelizeEagerLoadingError: Bookmark is not associated to Category!
flame_1  | {
flame_1  |   name: 'SequelizeEagerLoadingError',
flame_1  |   message: 'Bookmark is not associated to Category!'
flame_1  | }
flame_1  | SequelizeEagerLoadingError: Bookmark is not associated to Category!
flame_1  | All models were synced
flame_1  | Initial config created
flame_1  | External API request failed
^CGracefully stopping... (press Ctrl+C again to force)
Stopping flame_flame_1 ... done

regarding the first example, it could be that I simply didn't let it run long enough for it to throw the API request message

from flame.

roo82 avatar roo82 commented on June 23, 2024

I'm seeing the same thing when trying to access flame from behind an nginx reverse proxy. It works fine if I hit the site at the docker host:port itself, so I am guessing I'm missing some config or something. I can post my nginx config if that would help.

from flame.

pawelmalak avatar pawelmalak commented on June 23, 2024

I have never used reverse proxy before so I will try to setup one, check if I can reproduce this problem and then work from there. I suspect it all comes from this ws:// protocol.

from flame.

maeries avatar maeries commented on June 23, 2024

Indeed, it works when not using a reverse proxy

from flame.

Lanjelin avatar Lanjelin commented on June 23, 2024

Nginx behind reverse proxy with https, Chrome DevTools / Console spits out the following.

Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://example.com/socket'. This request has been blocked; this endpoint must be available over WSS.

DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

Suppose wss is needed to serve the content securely / via https.

Nginx using http is working perfectly with the following configuration (some of the settings could probably be skipped):

server {
    listen           80;
    listen      [::]:80;
    server_name home.example.com;
    location / {
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://192.168.1.148:5005;
        proxy_http_version 1.1;
        proxy_pass_request_headers on;
        proxy_set_header Connection "upgrade";
        proxy_store off;
    }
}

Bet it's the same thing with #23

from flame.

vmcosco avatar vmcosco commented on June 23, 2024

@maeries Do you have reverse proxy working on Caddy v2? For me it works on mobile (chrome & safari) but not on desktop (chrome). I just get the purple screen. If so, could you share your Caddyfile?

from flame.

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.