ronilaukkarinen / fedionfire

Watch every Mastodon/Fediverse post in real-time - filter the firehose
https://fedionfire.stream
9 stars 1 forks source link

Include more sources than just mastodon.social #4

Closed ronilaukkarinen closed 1 year ago

ronilaukkarinen commented 1 year ago

I have no idea how to implement this and maybe using relays is the answer (#3), but mastodon-firehose has done this in the past. It would be a blast to see as much sources as possible, since mastodon.social is just a start.

raikasdev commented 1 year ago

Fedi.buzz provides a Mastodon compatible streaming API at https://fedi.buzz/api/v1/streaming/public

It just doesn't have CORS, so using corsproxy.io the streaming API url would be https://corsproxy.io/?https%3A%2F%2Ffedi.buzz%2Fapi%2Fv1%2Fstreaming%2Fpublic.

@astro is adding CORS headers to Fedi.buzz streaming API possible?

astro commented 1 year ago

Could you instead redistribute that feed yourself so that I don't have to serve every one of your visitors? #FediBuzz has no budget.

raikasdev commented 1 year ago

Good point.

raikasdev commented 1 year ago

@ronilaukkarinen: a possibility could be to host an buzzrelay instance (with for example fedi.buzz streaming API), then reverse proxy that with CORS headers for the service. Or code some other proxy that only uses a single connection the fedi.buzz streaming API to avoid stressing it.

ronilaukkarinen commented 1 year ago

Okay I have the relay set up at relay.fireonfedi.stream, that seems to be now similar to relay.fedi.buzz, running on port 3000. But how can I stream that content via my relay? Is the source of fedi.buzz available somewhere? @astro @raikasdev

raikasdev commented 1 year ago

Doesn't seem like it 🤔

A possibility is to write a custom proxy that listens to fedi.buzz with a single socket and serves the events to fedionfire users to avoid stressing FediBuzz. Node, Bun? PHP probably won't do it as the socket needs to be persistent and a single one for all.

ronilaukkarinen commented 1 year ago

Perhaps. But I'm not familiar with it at all, don't even know where to start :( So help needed here.

astro commented 1 year ago

Run buzzrelay with the fedi.buzz streaming API just like in the example config.yaml. Point a HTTPS reverse proxy at this port 3000. Then following should work.

ronilaukkarinen commented 1 year ago

I did that but https://relay.fedionfire.stream/api/v1/streaming/public doesn't work that way. Also right now https://relay.fedionfire.stream returns 404 for some reason even though it's running... weird.

astro commented 1 year ago

Something seems to be broken in your reverse proxy setup.

raikasdev commented 1 year ago

I did not find the streaming endpoint in the source code, are you sure that the relay contains the code for the Streaming API compatible endpoints?

astro commented 1 year ago

buzzrelay connects to the streaming API endpoint, it doesn't serve it.

raikasdev commented 1 year ago

That's the point. We are trying to setup an own streaming API endpoint, like fedi.buzz/api/v1/streaming/public, not relay.fedi.buzz/...