kkuchta/css-only-chat

Seems to work just fine locally, but breaks when opening through an nginx reverse proxy

OfficialRenny opened this issue · 6 comments

Thought it'd be funny to host a public version of chat on my site but currently running into some issues.
The CSS only chat works just fine when accessed locally on my Pi using Chromium, but breaks horribly when visited over the internet.
When accessed over the internet, the buttons jump around, some disappear, the submit button may not be visible at some points but at others there are two of them, etc. And when you try to type, it doesn't really type what you're pressing in the right order and if you're lucky and actually get to see the Submit button, you can just spam it and it'd send two messages over and over.

How the online version can look
image

Local version
image

Hmm. My first wild guess would be there's some missing nginx config. Does chunked encoding need to be enabled? Is there some buffering issue?

Off the top of my head, I'd recommend starting by looking at your browser network log to see what requests are actually going through, in what order, and if they match the requests you expect to go through.

I've added a proxy_buffering off; to the location block in the nginx config and it seems to be better. Though now when pressing a letter you may see extra letters appear for a split second but then go away again, and sometimes when sending something, the message may get "stuck" and any future messages will appear behind the previous text, but still send just fine. Not sure if these bugs may be due to latency or something, as I don't have the fastest internet connection on my Pi.

image

Try to type slower, if the bug persists, the internet connection to your pi might be bad. The buttons jumping around is the css disabling the old buttons.

If the bug is due to a slow internet connection then that would be understandable, as it is a bit slow for my Pi

Can you write the deployment in more detail? I am not familiar with ruby, thank you!

@Godlys Which comment are you reffering to? If you want general deployment instructions, look in Install.md I guess you are talking about setting it up on a raspberry pi. If rvm is too much of a hassle, just install a recent version of Ruby with the package manager and install redis or redis-server depending on your distribution via your package manager