Code Monkey home page Code Monkey logo

Comments (31)

dalbodeule avatar dalbodeule commented on June 8, 2024

WebSocket 에 대한 룰은 설정하셨나요?

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

어떤 룰을 말씀하시나요? 딱히 건드린건 없습니다만..;;

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

라우터 측에서 말씀하시는거라면 모든 포트가 개방되어 있는 상태입니다.
또한 Nginx와 끄투 웹/게임 서버, Redis 서버는 모두 같은 서버 안에서 돌아가고 있습니다.
그게 아니라면 무엇을 건드려야 할까요..?

from kkutu.

msquid avatar msquid commented on June 8, 2024

그건 잘모르겠네요

from kkutu.

JJoriping avatar JJoriping commented on June 8, 2024

게임 서버에 접속하는 중 오류가 발생하여 멈춘 것일 수 있으니 웹 클라이언트에서 개발자 도구를 열어 콘솔에 오류가 나타나 있는지 확인해 보세요.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

확인해 보도록 하겠습니다.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

테스트를 해 보았습니다. 아무래도 게임 서버측에서 비보안 연결로서 로드가 되는 것 같은데, Nginx측에서 TLS를 사용하고 있어서 비보안 연결인 WebSocket측에서 HTTPS를 통해 데이터를 전송할 수 없는 문제가 발생하는 것 같습니다. 해결 방법이 있을까요..?
untitled

from kkutu.

dalbodeule avatar dalbodeule commented on June 8, 2024

소스를 조금 수정하셔서 wss 로 서버를 열어주시면 됩니다.

WebSocket 모듈의 doc를 조금 찾아보셔야겠네요.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

앗 찾아보도록 하겠습니다!

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

죄송합니다만 수정할 부분을 알려주실 수 있으신가요..?;;

from kkutu.

JJoriping avatar JJoriping commented on June 8, 2024

이 레포지토리에 대한 ws 검색 결과 페이지를 참고해 보세요.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

저기서 ws:// 부분만 wss://로 고치면 될까요?

from kkutu.

JJoriping avatar JJoriping commented on June 8, 2024

네 아마도... 잘 작동하길 바라겠습니다.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

해보도록 하겠습니다..!

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

나름대로 찾아서 바꿨다고 생각했는데, 웹서버는 열리지만 게임 서버와 연결이 되지 않네요.
게임 서버는 정상적으로 로딩되었고, 웹서버 로그를 뜯어보면 Game server #1 has an error: Error: socket hang up라고 합니다. 방법이 있을까요..?

from kkutu.

dalbodeule avatar dalbodeule commented on June 8, 2024

websocket 서버를 여는 부분에서 Secure Socket Server를 열도록 소스를 변경해주세요. 아마 https://npmjs.com/package/ws 문서를 잘 찾아보시면 Secure 서버를 여는 방법도 기술되어있을 것이라 봅니다.

from kkutu.

dalbodeule avatar dalbodeule commented on June 8, 2024

아.. 아니네요. 잠시만 기다려주세요. Secure Socket Server 를 여는 코드를 찾아보겠습니다.

from kkutu.

dalbodeule avatar dalbodeule commented on June 8, 2024

http://stackoverflow.com/questions/31338927/how-to-create-securetls-ssl-websocket-server

여기의 문서처럼 HTTPS 서버를 열어준 뒤에 WebSocket 서버를 그 HTTPS 서버에 물려주면 되는 것 같습니다.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

혹시 게임 서버와 웹 서버에서 WebSocket을 생성해 포트 리스닝을 하는 부분을 알 수 있을까요?

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

삽질 중입니다. 일단 이 이슈는 닫아두도록 하겠습니다.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

위 링크에서와 같이 WebSocket 서버를 생성하는 부분에 server: httpsServer를 넣어줬습니다만 httpsServer를 찾을 수 없다고 하네요.
수정한 부분은 ./Server/lib/Game/master.js:273, ./Server/lib/Game/slave.js:22부분입니다.

from kkutu.

JJoriping avatar JJoriping commented on June 8, 2024

http://stackoverflow.com/questions/22429744/how-to-setup-route-for-websocket-server-in-express

httpsServer는 프로그래머가 임의로 정한 변수 이름입니다. 위 글을 참고해 주세요.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

아아 그런거군요. 죄송합니다.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

한달만에 이슈 여네요. Nginx -(Reverse Proxy)- Node 웹서버 -(TLS)- Node 게임서버로 연결되도록 했습니다만 8080포트의 데이터가 보안 연결이 되지 않다고 나옵니다. 8080포트를 사용하는 게임 내 요소가 있나요?
image

from kkutu.

dalbodeule avatar dalbodeule commented on June 8, 2024

에러코드 찾아보니 ws:// 로 된 URL을 이용하여 연결하고 있는 것 같습니다 wss:// 로 된 URL로 연결되도록 Javascript 를 바꿔주시면 될 것 같습니다.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

ws://172.0.0.2 부분은 보안연결이 되도록 설정을 했습니다만 어딘가를 또 바꿔줘야 할까요?

from kkutu.

dalbodeule avatar dalbodeule commented on June 8, 2024

Webserver로 유저가 접속할 때도 wss:// 를 사용하도록 바꿔주시면 됩니다.

다만 이부분은 웹용 javascript 파일을 수정하셔야 되므로 ugly화를 하셔야 적용됩니다.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

소스를 뜯어보았습니다만 연결 방식이 달라 보입니다. 어떻게 수정해야할까요?

from kkutu.

JJoriping avatar JJoriping commented on June 8, 2024

8080 포트는 파일 ./Server/lib/sub/global.jsonMAIN_PORTS 부분에 기재된 값을 따릅니다. 이 값은 각 게임 서버에 할당되는 포트 번호이며 클라이언트와 게임 서버 사이의 통신에 쓰입니다.

from kkutu.

yom21c1020 avatar yom21c1020 commented on June 8, 2024

앗 감사드립니다. 픽스해보도록 하겠습니다.

from kkutu.

hatty163 avatar hatty163 commented on June 8, 2024

음... main.js에 listen 값을 443으로 바꾸고, ws://를 wss://로 바꿨는데, (main.js의
gameServers[i] = new GameClient(KEY, ws://127.0.0.2:${v}/${KEY}); / kkutu&m_kkutu.pug의
gameServers[i] = new GameClient(KEY, ws://127.0.0.2:${v}/${KEY});를 모두 wss://로 바꾸고 SSL 인증서를 발급받아도 http://kkutu.hatty163.com:443 은 들어가지나 https://kkutu.hatty163.com 은 들어가지지 않습니다. 하지만, Apache 기본 페이지에서는 (서버를 끄면 나옵니다) SSL이 적용되어 있습니다. 뭐가 문제인가요?

from kkutu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.