appleboy / gorush

A push notification server written in Go (Golang).
MIT License
7.94k stars 840 forks source link

Question: Support for standard websocket connections? #194

Open captjt opened 7 years ago

captjt commented 7 years ago

This package looks fantastic with all the capabilities and features it has already. I was wondering though if there is a plan to add in push notifications to websocket connections along with the APNS and GCM features that are already in place.

If there is would definitely like to know -- potentially can help out with that!

Thanks, Jordan

appleboy commented 7 years ago

Do you mean that send data to Gorush server using WebSocket? we only support HTTP post so far now. Right?

captjt commented 7 years ago

Correct so leveraging something like gorilla/websocket to send notifications through sockets.

appleboy commented 7 years ago

@jtaylor32 I Got it.

captjt commented 7 years ago

@appleboy fantastic!! Let me know if there is anything you need me to help on.

captjt commented 7 years ago

@appleboy just to clarify - this feature would be creating a notification from gorush to a client that is receiving messages with web sockets and not the admin endpoints that send the messages?

appleboy commented 7 years ago

No. GCM or APNS only support HTTP endpoints to send a notification to your device. We can't send the notification using WebSocket.

captjt commented 7 years ago

Right the use case I am looking for is lets say you have a web client that wants to send out a message -- that would currently hit a REST endpoint with the message etc. Then other than GCM/APNS would there be a way to fit just WebSocket on the outbound as well.

Web Client (REST Requests) -> Gorush <-> WebSocket Client

I can see that might be out of scope but having the capability of a websocket to receive the messages from the HTTP Client might be a viable use case for people to leverage.