mirror of
https://github.com/asapach/peerflix-server.git
synced 2026-04-25 14:45:50 +03:00
[GH-ISSUE #171] HTTP2 support #354
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SeyfSV on GitHub (Sep 9, 2019).
Original GitHub issue: https://github.com/asapach/peerflix-server/issues/171
Hi,
I tried to use peerflix-server with Kodi through my custom addon, but I got an issue with current Kodi version 18.* - it uses HTTP2 protocol for getting video files and nodejs http does not has mechanisms to fallback to HTTP.
Do you plan to add support for HTTP2?
@asapach commented on GitHub (Sep 9, 2019):
A PR is welcome.
Does Kodi require TLS? https://en.wikipedia.org/wiki/HTTP/2#Encryption
@SeyfSV commented on GitHub (Sep 9, 2019):
I do not think so.
Kodi uses CURL library for sending such requests. In previous version CURLOPT_HTTP_VERSION was CURL_HTTP_VERSION_1_1, and now CURL_HTTP_VERSION_2_0.
When I provide URL from peerflix-server (non TLS) it does not return errors. It sends request, but nodejs does not response to it.
You can check this behaviour by calling perflix-server from curl with --http2 key.
@htpcforall commented on GitHub (Sep 10, 2019):
Hi SeyfSV,
I have developed an add-on in kodi to stream torrents from my server running Peerflix. Working great. Although I'm using Krypton and Jarvis. Haven't tried 18. How are you implementing the torrent streaming process? Maybe I can help. Jay
@ghost commented on GitHub (Sep 10, 2019):
Pretty simple: https://github.com/asapach/peerflix-server/compare/master...pro-src:spdy?expand=1
@SeyfSV commented on GitHub (Sep 10, 2019):
Hi, @htpcforall ,
Yes, you are right, with previous version all working great, but Kodi 18 use HTTP2 by default.
I just put
linkfrom /torrents/{infoHash} response toPlayer.play()function.@SeyfSV commented on GitHub (Sep 10, 2019):
Hi, @pro-src ,
I checked you code, it does not work :(
Browser says "The connection was reset".
CURL returns
curl: (52) Empty reply from serveron both http1.1 and http2 calls.@ghost commented on GitHub (Sep 10, 2019):
@SeyfSV Fixed, I forgot to nest the options. I don't actually need this so I didn't test. :P
@SeyfSV commented on GitHub (Sep 10, 2019):
@pro-src HTTP2 still does not work.
@ghost commented on GitHub (Sep 10, 2019):
Hmm... Maybe I spoke too soon. I'll let you know once I've had a chance to test this myself.
@ghost commented on GitHub (Sep 11, 2019):
Ideally, this patch should just work (based on docs) but it seems like everything http2 in Node.js land is currently unstable. I'm sure there are workarounds but I don't actually intend on sending a PR for this, sorry, not that interested. So until express creates a compatibility layer around the builtin http2 request/response objects, I would leave this alone. Kodi is really to blame here, it should fallback to http/1.
Also note that the dependencies are outdated. Updating the dependencies is pretty simple when using
npm-check-updates:You'll hit an error though, due to some middlewares no longer being shipped with express:
Replace:
express.logger('dev')->require('morgan')('dev')in server/bin.jsIf you don't won't to work on this unstable area, maybe attempt to use a http2 proxy.
Good luck 😄
@SeyfSV commented on GitHub (Sep 11, 2019):
@pro-src , I totally agree with you about fallback to http/1.
And we are not alone: https://github.com/xbmc/xbmc/pull/16601
@asapach , I'll close this issue. Thnx!
@htpcforall commented on GitHub (Sep 13, 2019):
@SeyfSV Any chance I can test your add-on? Honestly, I'm would like to see how you implemented peerflix-server. I'm hungry for any knowledge around this a I would like to improve my add-ons functionality as much as possible. I would like to see if there's a way to solve the http2 issue as well. Hope to hear back. Thanks.
@SeyfSV commented on GitHub (Oct 4, 2019):
For info:
httpmodule supports http2 requests. Issue occurs insocket.iomodule, that interceptsUpgrade: h2cheader and brokes connection.As workaround I create socket Object only with
transports: 'pooling'option. Yes, it disables WebSocket, but it is not critical for me.@SeyfSV commented on GitHub (Oct 4, 2019):
Hi, @htpcforall. I am not ready for showing my add-on :)
I wrote this simple class for interact with peerflix-server.
Also you can look on my fork of peerflix-server (branch pooling)
@SeyfSV commented on GitHub (Oct 2, 2021):
Now HTTP2 can be disabled in Kodi:
https://kodi.wiki/view/Advancedsettings.xml
@timurlane commented on GitHub (Feb 8, 2022):
Hi @SeyfSV I was looking into developing a kodi plugin of my own (for Matrix). Did you end up succeeding with your project? I would really like to learn how to implement this.