audreyt / ethercalc

Node.js port of Multi-user SocialCalc
https://ethercalc.net
Other
2.96k stars 533 forks source link

Requests to /zappa/socket/__local/... (fail) #350

Open rugk opened 8 years ago

rugk commented 8 years ago

What is this request?

/zappa/socket/__local/zgFjzfQ9uhwqROQZAAAD

In my installation of Ethercalc in a subdir this file is always requested from my domain root. So it should actually fetch them from CustomSubDir/zappa/..., but it tries to fetch them from /zappa/.... BTW: Is this also a websocket?

I'm using --basedir and also some nginx rewrites (proxy_redirect).

audreyt commented 8 years ago

Yes it is a websocket. Try using --polling to disable that message.

rugk commented 8 years ago

No, websockets are okay. The issue is just that it is not rewritten correctly. As said I use --basedir, but @ZappaJS still uses the wrong URL for fetching the file.

So please reopen this issue. It may also be an issue on @ZappaJS's side. So am I right that the basedir option should add the specified dir to the request path?

rugk commented 8 years ago

So this is a workaround for nginx:

# workaround for https://github.com/audreyt/ethercalc/issues/350
location /zappa/socket/__local/ {
        rewrite (.*) /CustomSubDir$1;
}
rugk commented 8 years ago

It's still a workaround. The underlying issue should be fixed. So I advocate for opening this issue again.

audreyt commented 8 years ago

Sure! Feel free to work on it. :-)

rugk commented 8 years ago

I have no idea what to change, but maybe someone else knows why @ZappaJS does not use the correct URL...

sbraz commented 3 years ago

Hi @audreyt, is there any chance you could look at this old issue which is still relevant today?

I have been changing zappa_prefix in zappajs/lib/zappa.js but it's a terrible workaround which also requires more URL rewriting on the reverse proxy.

I also noticed that calls to these /calc/zappa/socket/… URLs always return the following error, even with the demo https://ethercalc.net/ site:

{
  "error": "No session"
}

Doesn't it mean that they could simply be dropped?

audreyt commented 3 years ago

That's likely, as we do not make use of cookie-based sessions.

A pull request to remove the call altogether would be appreciated.

sbraz commented 3 years ago

Thanks for the feedback. I have looked at the code but I don't have any experience with server-side JS and I haven't found a way to disable this.