HTML5 기술 중 하나인 WebSocket에 관심이 생겨서 이용해보았다.


jWebSocket은 java로 만든 것이고, 여기서 다운로드 받으면 된다. 


하던 중 다음과 같은 에러가 나서 짜증 ㅡ"ㅡ 


에러: client origin 'null' does not match allowed domains


확인해보니 chrome에서 origin값을 null로 셋팅하는 것같다.


서버쪽 conf 폴더에 jWebSocket.xml이라는 파일이 있다. 여기에 다음과 같이 해준다.


<!-- CAUTION! -->

<!-- not all browsers automatically accept self-signed certificates -->

<!-- please follow instructions on the jWebSocket.org website, how

     to trust self-signed certificates for the various browsers or

 how to import signed private key/certificate bundles into the keystore -->


<!-- these domains are accepted by the engine listening on the above mentioned port -->

<!-- you optionally can add asterisks as wild cards -->

<domains>

<domain>http*://jwebsocket.org</domain>

<domain>http*://jwebsocket.com</domain>

<domain>http*://*.jwebsocket.org</domain>

<domain>http*://*.jwebsocket.com</domain>

<domain>http*://10.10.*</domain>

<domain>http*://10.21.*</domain>

<domain>http*://192.168.*</domain>

<domain>http*://localhost*</domain>

<domain>*</domain>

</domains>

....


빨간색 부분이 내가 설정해준 부분이다. 이렇게 하고 서버 돌리면 끝.


client쪽 demo 폴더에 보면 여러가지 예제들이 있다.


Posted by DevMoon
,