Skip to content

6주차 [Network] WebSocket#43

Open
KJY97 wants to merge 4 commits intono-study-no-future:KJY97from
KJY97:WebSocket
Open

6주차 [Network] WebSocket#43
KJY97 wants to merge 4 commits intono-study-no-future:KJY97from
KJY97:WebSocket

Conversation

@KJY97
Copy link

@KJY97 KJY97 commented Jan 23, 2022

#42

@ChaerinYu ChaerinYu added the Network Network label Jan 23, 2022
Copy link

@doho-ho doho-ho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘 읽었습니다.

  • WebSocket 기술은 몇번의 포트번호를 사용하나요?
  • TCP 프로토콜과 WebSocket 프로토콜의 차이는 무엇인가요?
  • Upgrade header에 대한 설명도 추가되면 좋을 것 같습니다.
  • HTTP를 이용한 브라우저에서 활용되는 기술이니만큼 HTTP와 WebSocket의 차이점에 대해서 정리되어있었으면 좋겠습니다.


- 웹소켓 연결은 HTTP 프로토콜을 통해 이루어짐
- handshake 과정이 성공적으로 끝나면 HTTP를 웹소켓 프로토콜로 바꾸는 protocol switching 과정이 진행됨
- 이후 웹소켓을 위한 새로운 소켓이 만들어지고 이 소켓을 이요해 통신한다.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이요해 -> 이용해

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정하겠습니다!


> 웹소켓이란 서버와 클라이언트 간의 효율적인 양방향 통신이 가능한 방법으로, 기본적으로 stateful protocol 방식이다.
>
> 정보를 실시간 교류할 수 있디 때문에 채팅, 주식과 같은 즉각적인 변화를 감지해야 하는 서비스에 좋다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 오타가 있네요.. !
있디 👉 있기

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정하겠습니다!

@leeejuhyeong
Copy link
Member

WebSocket은 TCP와 다르게 어떻게 클라이언트의 요청없이 서버와 통신하는 건가요?
WebSocket 사용 시 서버와의 연결이 이루어져야한다는데 언제 서버와 연결을 하나요?(백이 가동되자마자? 혹은 WebSocket을 사용하는 기능이 실행될때?)

@KJY97
Copy link
Author

KJY97 commented Jan 23, 2022

@Kodo92

  • WebSocket 기술은 몇번의 포트번호를 사용하나요?
  • TCP 프로토콜과 WebSocket 프로토콜의 차이는 무엇인가요?
  • Upgrade header에 대한 설명도 추가되면 좋을 것 같습니다.
  • HTTP를 이용한 브라우저에서 활용되는 기술이니만큼 HTTP와 WebSocket의 차이점에 대해서 정리되어있었으면 좋겠습니다.
  • HTTP와 마찬가지로 80번, 443번 포트 이용합니다.
  • TCP는 단방향 프로토콜, 웹소켓은 TCP를 기반으로 구축된 양방향 프로토콜.. 요정도만 알고있습니다ㅠ
  • 추가하겠습니다!
  • 추가하겠습니다!

@KJY97
Copy link
Author

KJY97 commented Jan 23, 2022

WebSocket은 TCP와 다르게 어떻게 클라이언트의 요청없이 서버와 통신하는 건가요? WebSocket 사용 시 서버와의 연결이 이루어져야한다는데 언제 서버와 연결을 하나요?(백이 가동되자마자? 혹은 WebSocket을 사용하는 기능이 실행될때?)

처음 클라이언트와 서버가 연결될 때는 3핸드쉐이크로 연결을 합니다.(즉, 처음에는 클라이언트가 서버에 요청해야 함)
이후에는 연결이 끊어지기 전까지 데이터를 서로 주고받다가 close 프레임을 주고 받으면 연결이 종료됩니다.

@doho-ho
Copy link

doho-ho commented Jan 23, 2022

HTTPS의 443번 포트도 호환되는 것으로 알고있습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Network Network

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants