how to integration a websocket api gateway to my lightsail instance?

0

hey guys, This may be a very beginner question, but I really can't find the answer. I just hope the client can establish a WebSocket connection with my Lightsail instance through the API gateway. the AWS Q tell me should set the proxy_integration, but I can't find this option in the integration page. there only opts like"Lambda function" "HTTP" "AWS service", do I looked the wrong place? thank you

2개 답변
2
수락된 답변

You should choose the HTTP integration, and when you do, you will be able to choose a Proxy integration that passes all information to the backend in an HTTP request. In your Lightsail server you will need to run an HTTP server that will listen to those HTTP requests. When your server will need to send a message to the client, it will need to make an API call to API Gateway's @connection end point.

profile pictureAWS
전문가
Uri
답변함 4달 전
profile pictureAWS
전문가
검토됨 4달 전
  • Thank you for your response, I appreciate it. So does this mean that the websocket API gateway cannot directly connect to an instance via websocket, and the only option is to change the backend server to HTTP?

  • Correct. The websocket connection itself is terminated at the API Gateway, and it uses HTTP requests to communicate with the backend integrations. If you want a websocket to your backend, don't use API Gateway.

0

Hi,vegetabo,I don't know you whether know the "X-UI",maybe you can try this and easily to use socket

답변함 4달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠