diff --git a/websocket_utils/websocket_utils.go b/websocket_utils/websocket_utils.go index c6a62245e8931fdff591fbdd795602ad5bfd2954..3a77890ddbeb692af6d7008741ce98c55afa838f 100644 --- a/websocket_utils/websocket_utils.go +++ b/websocket_utils/websocket_utils.go @@ -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