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

why sse is not supported (unsupported connection endpoint) #90

Open
icobani opened this issue Apr 14, 2024 · 4 comments
Open

why sse is not supported (unsupported connection endpoint) #90

icobani opened this issue Apr 14, 2024 · 4 comments

Comments

@icobani
Copy link

icobani commented Apr 14, 2024

i try to sse but get error message unsupported connection endpoint . Why we need this control.

github.com/centrifugal/centrifuge-go/client.go:114

	for _, e := range endpoints {
		if !strings.HasPrefix(e, "ws") {
			panic(fmt.Sprintf("unsupported connection endpoint: %s", e))
		}
	}
@FZambia
Copy link
Member

FZambia commented Apr 14, 2024

Hello @icobani

This is a bidirectional SDK for Centrifuge/Centrifugo. See the difference in Centrifugo documentation. WebSocket is the most effective transport for bidirectional communication in our ecosystem.

Probably if you need SSE on the Go side you need to use unidirectional protocol of Centrifugo where we expect developers won't use any SDK provided by Centrifugal Labs and connect to SSE endpoint using existing SSE-compliant clients.

@icobani
Copy link
Author

icobani commented Apr 15, 2024

Thank you @FZambia,

If you don't mind, could you please share an example of sending a server side message to the SSE address via this package?

@icobani icobani closed this as completed Apr 15, 2024
@icobani icobani reopened this Apr 15, 2024
@FZambia
Copy link
Member

FZambia commented Apr 15, 2024

If you don't mind, could you please share an example of sending a server side message to the SSE address via this package?

I think you are missing some core ideas as your question simply does not make any sense in the context of this SDK.

To use SSE and deliver real-time message:

  1. Follow unidirectional protocol description of Centrifugo to connect (for example, connect to SSE endpoint, use any SSE client implementation)
  2. Use server API to publish messages to channels connection is subscribed to

I.e. this package won't be involved at all.

I understand that documentation could contain more examples – I will try to provide some basic one in the future.

This SDK is for bidirectional client communication with Centrifugo over WebSocket only.

@icobani
Copy link
Author

icobani commented Apr 15, 2024

Thanks very much for your interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants