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

Pleroma and GoToSocial support #37

Open
velartrill opened this issue Oct 25, 2019 · 6 comments
Open

Pleroma and GoToSocial support #37

velartrill opened this issue Oct 25, 2019 · 6 comments
Labels
enhancement go to social help wanted pleroma This issue needs a Pleroma user to look into it.

Comments

@velartrill
Copy link
Contributor

bitlbee-mastodon currently does not support pleroma, because pleroma requires the use of websockets to subscribe to its event stream, and bitlbee-mastodon uses the mastodon-style streaming API instead. we may want to look at bitlbee-discord, which already uses websocket - it might be possible to translate its implementation to the pleroma API.

@kensanata
Copy link
Owner

Anybody interested in helping out, the beginning of some code is in the websockets branch: #43.

@kensanata
Copy link
Owner

kensanata commented Dec 8, 2019

I currently able to sign in to a Pleroma instance, but I keep getting disconnected:

pleroma - Logging in: Verifying credentials
pleroma - Logging in: Getting home timeline
pleroma - Login error: Failed to switch to websocket mode for /api/v1/streaming?stream=user
pleroma - Logging in: Signing off..
fedialexschroederch_kens QUIT bitlbee.localhost mastodon.localhost

Looks like the request I'm sending is something like this:

HTTP/1.1 
Host: fedi.alexschroeder.ch 
Connection: keep-alive, Upgrade 
Upgrade: websocket 
Origin: https://fedi.alexschroeder.ch 
Pragma: no-cache 
Cache-Control: no-cache 
Authorization: Bearer XXXXXXXXXXXXXXXXXXXX
Sec-WebSocket-Version: 13 
Sec-WebSocket-Key: 57tuV1d0Q1g6fZmC3nnwTQ== 
User-Agent: BitlBee 3.6 

And the reply I'm getting from my Pleroma instance is something like this:

HTTP/1.1 403 Forbidden 
content-length: 0 
date: Sun, 08 Dec 2019 19:43:48 GMT 
server: Cowboy 

@kensanata
Copy link
Owner

That issue was solved by also appending the access token as a parameter to the URL. This goes against what I believe is correct. It should be passed along as an HTTP header. Oh well.

@kensanata
Copy link
Owner

kensanata commented Dec 8, 2019

Next problem: I'm getting empty websocket messages that cannot be parsed, I'm not seeing any statuses in my timeline and I'm being disconnected after 2min.

23:12 <root> pleroma - Logging in: Websocket connected: /api/v1/streaming?stream=user
23:12 <root> pleroma - Logging in: Logged in
23:12 <root> pleroma - Data to parse /api/v1/streaming?stream=user:  (0 bytes)
23:12 <root> pleroma - Error: Unparsed data on /api/v1/streaming?stream=user: 
23:12 <root> pleroma - Data to parse /api/v1/streaming?stream=user:  (0 bytes)
23:12 <root> pleroma - Error: Unparsed data on /api/v1/streaming?stream=user: 
23:13 <root> pleroma - Data to parse /api/v1/streaming?stream=user:  (0 bytes)
23:13 <root> pleroma - Error: Unparsed data on /api/v1/streaming?stream=user: 
23:13 <root> pleroma - Data to parse /api/v1/streaming?stream=user:  (0 bytes)
23:13 <root> pleroma - Error: Unparsed data on /api/v1/streaming?stream=user: 
23:14 <root> pleroma - Error: Connection timeout
23:14 <root> pleroma - Signing off..
23:14 *** fedialexschroederch_kens QUIT bitlbee.localhost mastodon.localhost
23:14 <root> pleroma - Logging in: Reconnecting in 5 seconds..
23:14 <root> pleroma - Logging in: Login
23:14 <root> pleroma - Logging in: Connecting
23:14 *** fedialexschroederch_kens JOIN

@velartrill
Copy link
Contributor Author

velartrill commented Dec 9, 2019 via email

@ToxicFrog
Copy link

This also affects support for GoToSocial, which implements the websocket API but not the SSE one.

@kensanata kensanata changed the title pleroma support Pleroma and GoToSocial support Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement go to social help wanted pleroma This issue needs a Pleroma user to look into it.
Projects
None yet
Development

No branches or pull requests

3 participants