2016-06-09 5 views
0

내 Azure WebApp에서 websockets에 문제가 있습니다.웹 소켓 연결 시간이 초과되었습니다

저는 github에서 Node-red를 복제하고 Azure의 새로운 웹 애플리케이션 (VisualStudioOnline 사용)에 게시했습니다. 모든 패키지를 설치하고 불평을 사용하여 솔루션을 빌드합니다. (설명한대로 here)

그 후 나는 settings.js를 변경하고 azure가 웹 소켓을 지원하도록 구성했습니다. (기재된 바와 같이 here).

그러나 WebSocket을 여전히 작동하지 않습니다

Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT

내가 문제를 나타내는 서버 측에서 어떤 로그/경고를 볼 수 없습니다 : 크롬은 다음과 같은 오류를 표시한다.

+0

Chrome 콘솔에 'localStorage.debug ='* ';'를 입력하고 추가 socket.io- 디버그 정보를 위해 페이지를 새로 고침 – InsOp

답변

1

이 문제는 프록시에서 비롯되었습니다. Here은 문제를 설명하는 게시물입니다.

If an unencrypted WebSocket connection (ws://) is used, then in the case of transparent proxy servers, the browser is unaware of the proxy server, so no HTTP CONNECT is sent. As a result, the connection is almost likely to fail in practice today.

If an encrypted WebSocket Secure connection (wss://) is used, then in the case of transparent proxy servers, the browser is unaware of the proxy server, so no HTTP CONNECT is sent. However, since the wire traffic is encrypted, intermediate transparent proxy servers may simply allow the encrypted traffic through, so there is a much better chance that the WebSocket connection will succeed if an encrypted WebSocket connection is used.

그러므로 난 그냥

<rule name="https redirect" stopProcessing="true"> 
    <match url="(.*)" /> 
    <conditions> 
     <add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
    </conditions> 
    <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /> 
</rule> 

다음 다시 쓰기 규칙 (의 Web.config)를 사용하여 HTTPS 사이트로 리디렉션을 강제 않았다 그리고 모든 것이 예상 작동하기 때문에보다.

0

다음 사항에주의하고 응용 프로그램에서 수정하고 다시 시도하십시오.

  1. https://github.com/node-red/node-red#developers을 통해 로컬에서 node-red 애플리케이션을 실행 해보십시오. 특히 응용 프로그램을 완료하려면 grunt build 명령을 실행하십시오.
  2. .gitignore에서 무시 폴더

    coverage 
    credentials.json 
    flows*.json 
    nodes/node-red-nodes/ 
    node_modules 
    public 
    locales/zz-ZZ 
    nodes/core/locales/zz-ZZ 
    

    를 제거 후 푸른에 창녀 완성 된 프로젝트를 배포하려고합니다.

  3. settings.js 파일의 uiPort: process.env.PORT || 1880,을 수정하십시오.

더 궁금한 점이 있으면 언제든지 알려주세요.

+0

노력에 감사드립니다. 로컬로 모든 것을 빌드하고 실행 했으므로 정상적으로 작동했습니다. 나는 콘솔을 사용하여 azure webapp에 솔루션을 구축했습니다. 문제는 우리의 기업 인프라, 더 정확하게는 프록시에서 비롯되었습니다. 나는 대답을 추가 할 것이다. – Console