-
Notifications
You must be signed in to change notification settings - Fork 555
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
Handle disconnect route of Websocket #548
Changes from all commits
a8d57a0
5cdae93
a8fbffb
2da54a0
9acd9d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"headers": { | ||
"Host": "dl7ptocha9.execute-api.ap-northeast-1.amazonaws.com", | ||
"x-api-key": "", | ||
"X-Forwarded-For": "", | ||
"x-restapi": "" | ||
}, | ||
"multiValueHeaders": { | ||
"Host": [ "dl7ptocha9.execute-api.ap-northeast-1.amazonaws.com" ], | ||
"x-api-key": [ "" ], | ||
"X-Forwarded-For": [ "" ], | ||
"x-restapi": [ "" ] | ||
}, | ||
"requestContext": { | ||
"routeKey": "$disconnect", | ||
"disconnectStatusCode": 1001, | ||
"eventType": "DISCONNECT", | ||
"extendedRequestId": "R1koeHsUtjMFbRw=", | ||
"requestTime": "20/Jan/2024:11:55:08 +0000", | ||
"messageDirection": "IN", | ||
"disconnectReason": "", | ||
"stage": "prod", | ||
"connectedAt": 1705751697419, | ||
"requestTimeEpoch": 1705751708326, | ||
"identity": { | ||
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36", | ||
"sourceIp": "49.105.91.154" | ||
}, | ||
"requestId": "R1koeHsUtjMFbRw=", | ||
"domainName": "dl7ptocha9.execute-api.ap-northeast-1.amazonaws.com", | ||
"connectionId": "R1kmxc2VNjMCFIA=", | ||
"apiId": "dl7ptocha9" | ||
}, | ||
"isBase64Encoded": false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"requestContext": { | ||
"routeKey": "$default", | ||
"messageId": "R1knPc2ntjMCFIA=", | ||
"eventType": "MESSAGE", | ||
"extendedRequestId": "R1knPH17NjMFftw=", | ||
"requestTime": "20/Jan/2024:11:55:00 +0000", | ||
"messageDirection": "IN", | ||
"stage": "prod", | ||
"connectedAt": 1705751697419, | ||
"requestTimeEpoch": 1705751700453, | ||
"identity": { | ||
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36", | ||
"sourceIp": "49.105.91.154" | ||
}, | ||
"requestId": "R1knPH17NjMFftw=", | ||
"domainName": "dl7ptocha9.execute-api.ap-northeast-1.amazonaws.com", | ||
"connectionId": "R1kmxc2VNjMCFIA=", | ||
"apiId": "gy415nuibc" | ||
}, | ||
"body": "{\r\n\t\"a\": 1\r\n}", | ||
"isBase64Encoded": false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,11 +97,11 @@ | |
"extendedRequestId": "TWegAcC4EowCHnA=", | ||
"integrationLatency": "123", | ||
"messageDirection": "IN", | ||
"messageId": null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "messageId" field is not documented for CONNECT eventType. And I couldn't find out a way to keep this field here in the testdata and also to keep the MessageID field of the What should I do? |
||
"requestTime": "07/Jan/2019:09:20:57 +0000", | ||
"requestTimeEpoch": 0, | ||
"routeKey": "$connect", | ||
"status": "*" | ||
}, | ||
"body": "{\r\n\t\"a\": 1\r\n}" | ||
"body": "{\r\n\t\"a\": 1\r\n}", | ||
"isBase64Encoded": false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a reference to these fields in the AWS Docs, nor in the event libraries for .NET or Java.
Do you happen to have a reference handy? My search skills are failing me right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I found this sample online, you can also recreate this by looking into the websocket api gateway log in cloudwatch. I couldn't find anything in the aws documents neither.
Link to the sample: Links2004/arduinoWebSockets#667
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also found here: boto/boto3#3789
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I'll need a reference that comes from docs.aws.amazon.com
I'll otherwise make time to walk myself through the developer guide so that I can reproduce the test payloads in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this developer guide updated!
https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-requests.html#api-gateway-simple-proxy-for-lambda-input-format-websocket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything else I can do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's perfect! Thanks for following up!