
Photo by Christopher Robin Ebbinghaus on Unsplash Websocket의 대표적인 사용처는 채팅이 아닐까? 지금까지 살펴본 websocket의 동작이 실제 애플리케이션에서 어떻게 구현되고 활용되는지를 gorilla/websocket 패키지에서 제공하는 채팅 예제의 서버쪽 코드로 알아보겠다. websocket connection이 이루어지고 나서 message를 주고 받는 것은 서버와 클라이언트에 차이가 없기 때문이다. 구글링 해보면 이 예제에 대한 분석과 설명은 꽤나 많다. GitHub: https://github.com/gorilla/websocket/tree/master/examples/chat Websocket connection 클라이언트가 서버의 /ws end..

Photo by Christopher Robin Ebbinghaus on Unsplash 이전 포스팅에서 websocket 전반을 둘러보며 처음 연결시의 handshake를 정리했었는데 이 부분의 코드가 gorilla/websocket 패키지에서는 어떻게 구현되어 있는지를 살펴보자 이전 포스팅: https://jusths.tistory.com/249 GitHub(gorilla/websocket): https://github.com/gorilla/websocket GitHub(gorilla/websocket echo example): https://github.com/gorilla/websocket/tree/master/examples/echo Websocket connection을 위한 handshake..

Photo by Christopher Robin Ebbinghaus on Unsplash Websocket protocol을 보면 mask 여부를 표시하는 flag bit와 masking 적용시 사용할 maksing-key값이 들어가있다. 찾아보니 cache poisoning을 방지해준다 한다. cache poisoning이 뭘까? cache poisoning이란 - 초간단 버전 cache poisoning까지 실제로 해보고, websocket message를 masking/non-masking 했을때의 차이까지 들여다보고 싶어졌지만 있었지만 토끼굴로 들어가면 안된다 싶어 최소한의 이해만 하고 넘어가도록 한다. * 토끼굴(rabbit hole): a situation in which you become ..

Photo by Christopher Robin Ebbinghaus on Unsplash 간단하게 메시지를 주고 받는 websocket server를 만들어 볼 일이 있었다. gorilla/webscoket의 예제를 참고하여 server와, 테스트를 위한 client까지 동작시켜 보았는데 이참에 개념을 좀더 들여다보자 싶어져서 자료를 찾아 정리해보았다. 이어서 gorilla/webscoket 패키지의 구현을 들여다보려 한다 참고 링크(라고 하고 거의 번역을 한 수준): https://sookocheff.com/post/networking/how-do-websockets-work/ GitHub(gorilla/websocket): https://github.com/gorilla/websocket Websoc..
- Total
- 386,764
- Today
- 16
- Yesterday
- 307
- 마셜
- 2022
- Handshake
- heap
- solid
- install
- postgres
- Gin
- golang
- 명상
- websocket
- ORM
- additional data
- 비폭력대화
- powershell
- docker
- go
- agile
- AES
- 하드씽
- bun
- timestamp
- 클린 애자일
- gcm
- branch
- min heap
- 자아
- gorilla/websocket
- 로젠버그
- 독서후기