utmgdsc / PollVotingSystem

MCS Project with Prof. Zingaro and Prof. Ilir
https://poll.utm.utoronto.ca
MIT License
6 stars 10 forks source link

Production version fails to negotiate WebSocket upgrade #50

Closed embeddedt closed 1 year ago

embeddedt commented 2 years ago

Problem

The production version of the poll voting app (https://poll.utm.utoronto.ca/) does not allow clients to upgrade to WebSockets for communication, forcing them to use inefficient HTTP polling instead. This could lead to heavy network traffic when there are many concurrent users.

Expected behavior

This screenshot is taken by running the production docker-compose.yaml setup (including the Nginx proxy) locally and browsing to the root page. image

Actual behavior

This screenshot is taken by browsing to https://poll.utm.utoronto.ca/. image

embeddedt commented 2 years ago

I have gotten the local setup to use HTTPS with a self-signed certificate. Surprisingly, WebSockets still seem to work, so there must be some other difference between this and production. :thinking:

image

shubhbapna commented 2 years ago

I wonder if this related to Shibboleth (It's what we use for UofT SSO)

embeddedt commented 2 years ago

It very well could be if Shibboleth proxies HTTP requests. Is there a way of setting up a local instance of that?

shubhbapna commented 2 years ago

I haven't tried it but this might work https://isea.utoronto.ca/services/weblogin/sso-howto-weblogin/

shubhbapna commented 1 year ago

Thanks for your help @embeddedt !!!

Just to summarize the solution, we ended up using your configuration for the apache reverse proxy. In addition to that there was a misconfiguration in the reverse proxy which lead to sending the /socket.io requests to the wrong place.