[Docker] Cpp Boost WebSocket Client/Server

2024. 5. 9. 11:30ใ†ComputerScience/DockerKubernetes

 

 

 

 

 

# WebSocket Server/Client with Docker Compose

https://github.com/Chrischuck/websocket-docker-example

 

GitHub - Chrischuck/websocket-docker-example: Example of a real time chat application with React, Express, Postgres, and Docker.

Example of a real time chat application with React, Express, Postgres, and Docker. - Chrischuck/websocket-docker-example

github.com

: Cpp ์›น์†Œ์ผ“ ์˜ˆ์‹œ ํ”„๋กœ์ ํŠธ ๋Œ๋ ค๋ณด๊ธฐ 

 

 

 

 

 

git clone

 

 

 

์‹ ๊ธฐํ•ด๋ณด์—ฌ์„œ ์‹คํ–‰์‹œ์ผœ๋ดค์Šต๋‹ˆ๋‹ค :)

 

 

 

docker compse up

 

 

 

์ฑ„ํŒ…์ฐฝ ํ˜•์‹์˜ ํด๋ผ์ด์–ธํŠธ ํ™”๋ฉด์ด ๋ณด์ž…๋‹ˆ๋‹ค!

 

 

 

 

 

# Cpp Boost WebSocket 

https://github.com/boostorg/beast

 

GitHub - boostorg/beast: HTTP and WebSocket built on Boost.Asio in C++11

HTTP and WebSocket built on Boost.Asio in C++11. Contribute to boostorg/beast development by creating an account on GitHub.

github.com

 

 

 

brew install boost

 

 

 

 

 

๐Ÿบ

boost ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๋จผ์ € ์„ค์น˜ํ•ด์ค๋‹ˆ๋‹ค

์ดํ›„ VSCode์—์„œ path๋ฅผ ์„ค์ •ํ•ด์ฃผ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. (.vscode) 

์ด๋•Œ brew๋ฅผ ํ†ตํ•ด ๋‹ค์šด๋ฐ›์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ๊ฒฝ๋กœ๊ฐ€ ๊ถ๊ธˆํ•˜๋‹ค๋ฉด 

brew info boost

 

brew info Appname ํ˜•์‹์œผ๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค :) 

 

 

 

 

 

c_cpp_properties.json ํŒŒ์ผ ์ˆ˜์ • (๊ฒฝ๋กœ ์ถ”๊ฐ€)

 

 

 

tasks.json (I/L ๋‘˜ ๋‹ค ์ถ”๊ฐ€)

 

 

 

 

 

* ์ฐธ๊ณ  ์ž๋ฃŒ 

https://actor-is-programmer.tistory.com/26

 

VS Code์—์„œ Boost Library ์‚ฌ์šฉ๋ฒ•

VS Code์—์„œ C++์‚ฌ์šฉ๋ฒ•์— ๊ด€ํ•œ ๊ธ€์€ ์•„์ฃผ ์•„์ฃผ ๋งŽ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ Boost Library ์„ธํŒ…๋ฐฉ๋ฒ•์€ ์ฐพ์„ ์ˆ˜ ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ์ด๊ฑธ ๋‹น์‹  ์ฐพ์•˜๋‹ค๋ฉด Lucky You. ์ฒ˜์Œ์—๋Š” ํ•œ์ฐธ c_cpp_properties.json์„ ์ˆ˜์ •ํ–ˆ๋Š”๋ฐ VS code๋Š” intel

actor-is-programmer.tistory.com

 

https://object-world.tistory.com/9

 

macOS์—์„œ ๋ถ€์ŠคํŠธ(Boost)๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‚ฌ์šฉํ•˜๊ธฐ

Home brew(ํ™ˆ ๋ธŒ๋ฃจ) macOS์šฉ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ์ž๋กœ ํ„ฐ๋ฏธ๋„์—์„œ ๋ช…๋ น์„ ํ†ตํ•ด ์‰ฝ๊ฒŒ ํ•„์š”ํ•œ ํ”„๋กœ๊ทธ๋žจ์„ ์„ค์น˜, ์‚ญ์ œ, ์—…๋ฐ์ดํŠธ ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๋Š” RedHat ๊ณ„์—ด์˜ ๋ฆฌ๋ˆ…์Šค์—์„œ ์‚ฌ์šฉํ•˜๋Š” yum ์ด๋‚˜ Ubuntu ๊ณ„์—ด์˜ ๋ฆฌ๋ˆ…์Šค

object-world.tistory.com

 

 

 

 

 

์„œ๋ฒ„ ์—ด๊ณ , ํด๋ผ์ด์–ธํŠธ์—์„œ Hello, Server! ๋ฉ”์„ธ์ง€ ํ™•์ธ ๐Ÿฅณ

 

 

 

 

 

๐Ÿ•บ

์ด๊ฒƒ ์ €๊ฒƒ ์ˆ˜์ •ํ•˜๋Š๋ผ, ์ƒ๊ฐ๋ณด๋‹ค ํ›จ์”ฌ ์˜ค๋ž˜ ๊ฑธ๋ ธ๋Š”๋ฐ,

ํ•ต์‹ฌ์€ .vscode ๋‚ด๋ถ€์—์„œ ๊ฒฝ๋กœ ์„ค์ •์„ ์ž˜ ํ•ด๋‘์ž ์ž…๋‹ˆ๋‹ค. . . 

๋‹ค์Œ์œผ๋กœ๋Š” ํ•ด๋‹น ํด๋ผ์ด์–ธํŠธ, ์„œ๋ฒ„ ์›น์†Œ์ผ“ ์ฝ”๋“œ๋ฅผ

๋„์ปคํŒŒ์ผ์„ ํ™œ์šฉํ•˜์—ฌ ๋นŒ๋“œ ๋ฐ ์‹คํ–‰ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.