mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #753] [MERGED] Add basic websocket support #1061
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#1061
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?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/753
Author: @Johannesd3
Created: 5/23/2021
Status: ✅ Merged
Merged: 5/26/2021
Merged by: @Johannesd3
Base:
new-api← Head:new-api📝 Commits (1)
1ade02bAdd basic websocket support📊 Changes
11 files changed (+1040 additions, -68 deletions)
View changed files
📝
Cargo.lock(+136 -0)📝
core/Cargo.toml(+2 -1)📝
core/src/apresolve.rs(+18 -16)📝
core/src/connection/mod.rs(+2 -46)➕
core/src/dealer/maps.rs(+117 -0)➕
core/src/dealer/mod.rs(+586 -0)➕
core/src/dealer/protocol.rs(+39 -0)📝
core/src/lib.rs(+8 -3)📝
core/src/session.rs(+2 -2)➕
core/src/socket.rs(+35 -0)📝
core/src/util.rs(+95 -0)📄 Description
(Copied from https://github.com/librespot-org/librespot/discussions/734#discussioncomment-772619)
So, here's my first attempt of websocket support: https://github.com/Johannesd3/librespot/tree/new-api/core/src/dealer
Builderstruct to register handlers before a connection is established.Builderis created, there are two ways to launch theDealer:Builder::launch: Attempts to connect, returns aDealeron success and an error otherwise.Builder::launch_in_background: Returns immediately aDealerand behaves as if it would be reconnecting (see below).RequestHandlerper uri. Currently, these handlers indicate success by returning a bool. But that's easy to change.serde/serde_json.gzip-decoded if necessary (using flate2). I was not able to test whether it works, I didn't receive a gzipped request (I didn't receive a request at all).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.