ethercalc icon indicating copy to clipboard operation
ethercalc copied to clipboard

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

Open rugk opened this issue 8 years ago • 9 comments

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).

rugk avatar May 19 '16 20:05 rugk

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

audreyt avatar May 20 '16 02:05 audreyt

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 avatar May 20 '16 11:05 rugk

So this is a workaround for nginx:

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

rugk avatar May 20 '16 11:05 rugk

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

rugk avatar May 20 '16 19:05 rugk

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

audreyt avatar May 20 '16 19:05 audreyt

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

rugk avatar May 20 '16 19:05 rugk

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?

sbraz avatar Dec 06 '20 22:12 sbraz

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

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

audreyt avatar Dec 08 '20 01:12 audreyt

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.

sbraz avatar Dec 08 '20 09:12 sbraz