Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Workaround] Kodi connection problem - cookie related #26

Closed
bugsyb opened this issue Apr 2, 2020 · 2 comments
Closed

[Workaround] Kodi connection problem - cookie related #26

bugsyb opened this issue Apr 2, 2020 · 2 comments
Labels

Comments

@bugsyb
Copy link

bugsyb commented Apr 2, 2020

Hi All,

This is just to share findings and workaround identified.

Problem description:

  • Cast Kodi was showing yellow triangle stating it can't connect to working Kodi,
  • Kodi side settings all configured as required,
  • tcp/HTTP level / GET /jsonrpc request was sent and tcp ACK returned by Kodi, but nothing else - it was sort of ignored at HTTP level.

Environment:

  • Firefox 74.0 (Linux),
  • Cast Kodi - 4.16.0,
  • Kodi 18.5 / Leia (CoreElec based though this shouldn't matter).
  • other web services running on same IP, different ports though.

Further investigation shown that running FF from fresh profile connects well to the same Kodi without any changes at other end.
Details investigation of the GET request sent to Kodi from original FF profile and compared to the one sent from fresh profile revealed that cookies for other service on the same IP has been sent:

    [truncated]Cookie: portainer
        Cookie pair: portainer
        Cookie pair: portainer
        Cookie pair [truncated]: portainer
        Cookie pair: portainer
        Cookie pair: portainer
        Cookie pair: portainer
        Cookie pair: PHPSESSID=123

Workaround:
Cookies were flushed and Cast Kodi was able to successfully connect to the Kodi.

Question:
Why would Firefox send some unrelated cookies to a different port even if same IP?

This is most probably Firefox issue, though exposed to me only due to problems with Cast Kodi and given that it is Cast Kodi behind the request, question is being raised here.

Merci pour le plugin génial.

@regseb
Copy link
Owner

regseb commented Apr 7, 2020

Thanks for the detailed problem, you may have found the cause of the issues #13 and #15. I've reproduced the issue and the problem does come from the cookies that increase the size of the HTTP request. Kodi's TCP server doesn't accept requests bigger than 1024 bytes.

This is not a bug in Firefox, cookies must be shared between the different ports of an address (bugzilla#469287). Cast Kodi shouldn't send cookies, but this isn't possible because there are no options in the WebSocket client (I proposed this feature to whatwg/websockets#18). At the moment I don't know how to fix this problem. 😕

@regseb regseb added the bug label Apr 7, 2020
tatankat added a commit to tatankat/castkodi that referenced this issue Jan 24, 2021
tatankat added a commit to tatankat/castkodi that referenced this issue Jan 24, 2021
tatankat added a commit to tatankat/castkodi that referenced this issue Jan 30, 2021
@regseb
Copy link
Owner

regseb commented Nov 17, 2022

Kodi "Matrix" 19.2 (released in October 2021 🎉) has increased the size of accepted requests to 64 Kio (before the limit was 1 Kio). With this new value, there should be no more problems with large requests due to cookies.

@regseb regseb closed this as completed Nov 17, 2022
@regseb regseb removed the help wanted label Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants