Skip to content
Snippets Groups Projects
Commit da19884f authored by Jano Hendriks's avatar Jano Hendriks
Browse files

#40 Fix sending data via websocket

parent 6aad83a8
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ func NewSession(session *session.Session) *APIGateWaySessionWithHelpers {
}
}
func (s APIGateWaySessionWithHelpers) PostToConnectionIDs(req *events.APIGatewayWebsocketProxyRequest, connectionIDs []string) error {
func (s APIGateWaySessionWithHelpers) PostToConnectionIDs(data []byte, req *events.APIGatewayWebsocketProxyRequest, connectionIDs []string) error {
if req == nil {
return errors.Error("websocket request is nil")
}
......@@ -62,7 +62,7 @@ func (s APIGateWaySessionWithHelpers) PostToConnectionIDs(req *events.APIGateway
s.APIGatewaySession.Endpoint = fmt.Sprintf("https://%s/%s", req.RequestContext.DomainName, req.RequestContext.Stage)
_, err := s.APIGatewaySession.PostToConnection(&apigatewaymanagementapi.PostToConnectionInput{
ConnectionId: &connectionID,
Data: []byte("This is a message sent to the requesting connection ID via websocket."),
Data: data,
})
if err != nil {
return err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment