-
Notifications
You must be signed in to change notification settings - Fork 29
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
ActionCable in Lambda #74
Comments
Not sure yet but I am 90% sure it is possible. There is this discussion here too. #73 |
This might be helpful to learn more. https://github.com/hopsoft/sr_mini |
Maybe some ViewComponent learning here too. |
Architect JS |
StimulusReflex & CableReady |
Here is also Action Cable protocol description: https://docs.anycable.io/misc/action_cable_protocol |
Few current posts on WebSockets & Rails demo apps. Need something simple to play with. Ended up making the lamby-ws project which was a 1/1 implementation from the https://hotwired.dev site on top of a fresh Lamby app.
Key:
|
When it is Fun Time |
AWS & WebSocket Related Resources
AppSync Specific |
Side Quests with AppSync & Community Learning |
Debug event, context for connect, default, disconnect. Connect{
"headers": {
"Cache-Control": "no-cache",
"Cookie": "_session=z5S1u4AQoN2vqGh3%2Bfk%2FpWgcIHCWNgGe1M%2BlspE%2Bq1FUQIwTcqcGc5tFyXr93bDZn6769vf4OqWUq4TXsHe8R4yZXC9zeIzBCOWOaaifW37sRue4JjVUFassXnN5vm%2B%2FWzfhFhIRFyT%2B9T0ePPWqdATgb0ZCHdA257tn25t9BeRrVqMbcSHF%2Fe%2B43tlfDLlPzc5WlZfkFjszX92zHSS5Lq7tC9fn3qDgzeKsoW9V8waP2oxgH6FD8U9jWZqidz2FxU8beB%2BNHhVWzUFGL%2B2o6qvo7MxNc099TWmlVE95mr7Ubu9AevD5mHxyMN42FMIeB2ARd0xBZ%2FD0AHDWHBWj5oMWpuy83UNE66w%3D--hMCIIgPEVKv6Eniv--1qQ1DjeVWmn2%2BxqOpGMksQ%3D%3D",
"Host": "3iku9itbbb.execute-api.us-east-1.amazonaws.com",
"Origin": "https://lamby-ws.custominktech.com",
"Pragma": "no-cache",
"Sec-WebSocket-Extensions": "permessage-deflate; client_max_window_bits",
"Sec-WebSocket-Key": "mnACBiGQM/8M+Wt3ftwKVQ==",
"Sec-WebSocket-Protocol": "actioncable-v1-json, actioncable-unsupported",
"Sec-WebSocket-Version": "13",
"User-Agent": "Amazon CloudFront",
"Via": "1.1 dfbe3a6f5b354f9a5f95a5a6814ce14e.cloudfront.net (CloudFront)",
"X-Amz-Cf-Id": "SM51fkUtGtL-3Xd3DxYpc8YxxYV5YtUT3ySVBUdEC_NlWj1diQehPA==",
"X-Amzn-Trace-Id": "Root=1-6439884a-78ce49cc6150826e3b1b29ff",
"X-Forwarded-For": "98.166.4.233, 130.176.179.72",
"X-Forwarded-Host": "lamby-ws.custominktech.com",
"X-Forwarded-Port": "443",
"X-Forwarded-Proto": "https"
},
"multiValueHeaders": {
"Cache-Control": [
"no-cache"
],
"Cookie": [
"_session=z5S1u4AQoN2vqGh3%2Bfk%2FpWgcIHCWNgGe1M%2BlspE%2Bq1FUQIwTcqcGc5tFyXr93bDZn6769vf4OqWUq4TXsHe8R4yZXC9zeIzBCOWOaaifW37sRue4JjVUFassXnN5vm%2B%2FWzfhFhIRFyT%2B9T0ePPWqdATgb0ZCHdA257tn25t9BeRrVqMbcSHF%2Fe%2B43tlfDLlPzc5WlZfkFjszX92zHSS5Lq7tC9fn3qDgzeKsoW9V8waP2oxgH6FD8U9jWZqidz2FxU8beB%2BNHhVWzUFGL%2B2o6qvo7MxNc099TWmlVE95mr7Ubu9AevD5mHxyMN42FMIeB2ARd0xBZ%2FD0AHDWHBWj5oMWpuy83UNE66w%3D--hMCIIgPEVKv6Eniv--1qQ1DjeVWmn2%2BxqOpGMksQ%3D%3D"
],
"Host": [
"3iku9itbbb.execute-api.us-east-1.amazonaws.com"
],
"Origin": [
"https://lamby-ws.custominktech.com"
],
"Pragma": [
"no-cache"
],
"Sec-WebSocket-Extensions": [
"permessage-deflate; client_max_window_bits"
],
"Sec-WebSocket-Key": [
"mnACBiGQM/8M+Wt3ftwKVQ=="
],
"Sec-WebSocket-Protocol": [
"actioncable-v1-json, actioncable-unsupported"
],
"Sec-WebSocket-Version": [
"13"
],
"User-Agent": [
"Amazon CloudFront"
],
"Via": [
"1.1 dfbe3a6f5b354f9a5f95a5a6814ce14e.cloudfront.net (CloudFront)"
],
"X-Amz-Cf-Id": [
"SM51fkUtGtL-3Xd3DxYpc8YxxYV5YtUT3ySVBUdEC_NlWj1diQehPA=="
],
"X-Amzn-Trace-Id": [
"Root=1-6439884a-78ce49cc6150826e3b1b29ff"
],
"X-Forwarded-For": [
"98.166.4.233, 130.176.179.72"
],
"X-Forwarded-Host": [
"lamby-ws.custominktech.com"
],
"X-Forwarded-Port": [
"443"
],
"X-Forwarded-Proto": [
"https"
]
},
"requestContext": {
"routeKey": "$connect",
"eventType": "CONNECT",
"extendedRequestId": "DYI7wFpqoAMFfmQ=",
"requestTime": "14/Apr/2023:17:07:22 +0000",
"messageDirection": "IN",
"stage": "cable",
"connectedAt": 1681492042962,
"requestTimeEpoch": 1681492042967,
"identity": {
"userAgent": "Amazon CloudFront",
"sourceIp": "130.176.179.72"
},
"requestId": "DYI7wFpqoAMFfmQ=",
"domainName": "3iku9itbbb.execute-api.us-east-1.amazonaws.com",
"connectionId": "DYI7wedwIAMCKgg=",
"apiId": "3iku9itbbb"
},
"isBase64Encoded": false
} {
"clock_diff": 1681486457423,
"deadline_ms": 1681492072985,
"aws_request_id": "d6f5961b-5034-4db5-b3a9-fa378133b0f0",
"invoked_function_arn": "arn:aws:lambda:us-east-1:576043675419:function:lamby-ws-production-WSConnectLambda-5in18cNskwz6",
"log_group_name": "/aws/lambda/lamby-ws-production-WSConnectLambda-5in18cNskwz6",
"log_stream_name": "2023/04/14/[$LATEST]55a1d458479a4546b64acca17af3a69f",
"function_name": "lamby-ws-production-WSConnectLambda-5in18cNskwz6",
"memory_limit_in_mb": "1792",
"function_version": "$LATEST"
} Default{
"requestContext": {
"routeKey": "$default",
"messageId": "DMD1edEHoAMCJog=",
"eventType": "MESSAGE",
"extendedRequestId": "DMD1eEUSIAMFoEQ=",
"requestTime": "11/Apr/2023:01:09:41 +0000",
"messageDirection": "IN",
"stage": "cable",
"connectedAt": 1681175313769,
"requestTimeEpoch": 1681175381974,
"identity": {
"sourceIp": "98.166.4.233"
},
"requestId": "DMD1eEUSIAMFoEQ=",
"domainName": "3iku9itbbb.execute-api.us-east-1.amazonaws.com",
"connectionId": "DMDq0cY1IAMCJog=",
"apiId": "3iku9itbbb"
},
"body": "{\"hello\": \"there\"}",
"isBase64Encoded": false
} {
"clock_diff": 1681163961062,
"deadline_ms": 1681175417127,
"aws_request_id": "2e785761-dd73-4cd6-8679-3a1c29b96b58",
"invoked_function_arn": "arn:aws:lambda:us-east-1:576043675419:function:lamby-ws-production-WSDefaultLambda-dUMtdfelRbcl",
"log_group_name": "/aws/lambda/lamby-ws-production-WSDefaultLambda-dUMtdfelRbcl",
"log_stream_name": "2023/04/11/[$LATEST]817ab291cb5e447e9b01e562f6d97ca1",
"function_name": "lamby-ws-production-WSDefaultLambda-dUMtdfelRbcl",
"memory_limit_in_mb": "1792",
"function_version": "$LATEST"
} Disconnect{
"headers": {
"Host": "911769d0hb.execute-api.us-east-1.amazonaws.com",
"x-api-key": "",
"X-Forwarded-For": "",
"x-restapi": ""
},
"multiValueHeaders": {
"Host": [
"911769d0hb.execute-api.us-east-1.amazonaws.com"
],
"x-api-key": [
""
],
"X-Forwarded-For": [
""
],
"x-restapi": [
""
]
},
"requestContext": {
"routeKey": "$disconnect",
"disconnectStatusCode": 1005,
"eventType": "DISCONNECT",
"extendedRequestId": "DD8hNHmSIAMF8MA=",
"requestTime": "08/Apr/2023:14:04:29 +0000",
"messageDirection": "IN",
"disconnectReason": "Client-side close frame status not set",
"stage": "cable",
"connectedAt": 1680962664455,
"requestTimeEpoch": 1680962669864,
"identity": {
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15",
"sourceIp": "98.166.4.233"
},
"requestId": "DD8hNHmSIAMF8MA=",
"domainName": "911769d0hb.execute-api.us-east-1.amazonaws.com",
"connectionId": "DD8gXeoaIAMCI9A=",
"apiId": "911769d0hb"
},
"isBase64Encoded": false
} {
"clock_diff": 1680958928478,
"deadline_ms": 1680962710403,
"aws_request_id": "1499e91f-9bdc-4a79-9171-d96475ebcc5d",
"invoked_function_arn": "arn:aws:lambda:us-east-1:831702759394:function:lamby-ws-production-WSDisconnectLambda-N9Ttmjd66gnN",
"log_group_name": "/aws/lambda/lamby-ws-production-WSDisconnectLambda-N9Ttmjd66gnN",
"log_stream_name": "2023/04/08/[$LATEST]107ded668c8e4edebde1c36756afa34b",
"function_name": "lamby-ws-production-WSDisconnectLambda-N9Ttmjd66gnN",
"memory_limit_in_mb": "1792",
"function_version": "$LATEST"
} |
Tailscale Lambda Extension for Containers: |
How would I go by using/implementing websocket with this? Would action cable work or should a different approach be used? WIP Application: https://github.com/customink/lamby-ws
The text was updated successfully, but these errors were encountered: