mercure

(โ˜… 5,299)

๐Ÿชฝ An open, easy, fast, reliable and battery-efficient solution for real-time communications

  • .gitignore
  • .golangci.yml
  • .goreleaser.yml
  • .markdownlintignore
  • .prettierignore
  • .textlintignore
  • authorization.go
  • authorization_deprecated.go
  • authorization_deprecated_test.go
  • authorization_notdeprecated.go
  • authorization_test.go
  • authorizationclaims_deprecated.go
  • authorizationclaims_notdeprecated.go
  • authorizationdetails.go
  • authorizationdetails_test.go
  • bearererror.go
  • bearererror_test.go
  • bolt.go
  • bolt_deprecated_test.go
  • bolt_test.go
  • Caddyfile
  • claimrequirestopic_deprecated.go
  • CLAUDE.md
  • CONTRIBUTING.md
  • COPYRIGHT
  • debugger.go
  • debugger_test.go
  • Dockerfile
  • e2e_test.go
  • event.go
  • event_test.go
  • example_test.go
  • go.mod
  • go.sum
  • handler.go
  • handlertopic_deprecated.go
  • handlertopic_notdeprecated.go
  • hardening_test.go
  • hub.go
  • hub_test.go
  • hubtopic_deprecated_test.go
  • identity.go
  • identity_test.go
  • jwtkeyfunc.go
  • jwtkeyfunc_test.go
  • LICENSE
  • llms.txt
  • local.go
  • local_test.go
  • localbench_test.go
  • localsubscriber.go
  • logging.go
  • matchbench_test.go
  • matcher_deprecated.go
  • matcher_notdeprecated.go
  • matcherclaim.go
  • matcherclaim_deprecated_test.go
  • matcherclaim_test.go
  • matcherhelpers_deprecated_test.go
  • matcherhelpers_test.go
  • matchertype.go
  • metrics.go
  • metrics_test.go
  • playground.go
  • playground_test.go
  • publish.go
  • publish_test.go
  • README.md
  • release.sh
  • reservedtopic.go
  • reservedtopic_test.go
  • resourcemetadata.go
  • resourcemetadata_test.go
  • SECURITY.md
  • subscribe.go
  • subscribe_deprecated_test.go
  • subscribe_notdeprecated_test.go
  • subscribe_test.go
  • subscribematchers.go
  • subscribematchers_deprecated_test.go
  • subscribematchers_test.go
  • subscriber.go
  • subscriber_deprecated_test.go
  • subscriber_test.go
  • subscriberbench_test.go
  • subscriberlist.go
  • subscriberlist_test.go
  • subscription.go
  • subscription_test.go
  • subscriptionclaim_deprecated_test.go
  • subscriptiontopic_deprecated_test.go
  • topicmatcher.go
  • topicmatcher_deprecated.go
  • topicmatcher_deprecated_test.go
  • topicmatcher_notdeprecated.go
  • topicmatcher_notdeprecated_test.go
  • topicmatcher_test.go
  • tracer.go
  • tracer_test.go
  • transport.go
  • transport_deprecated.go
  • update.go
  • update_test.go
  • updatehelpers_test.go

# ์„ค์น˜ ๊ฐ€์ด๋“œ

1. ์ฝ”๋“œ ๋‚ด๋ ค๋ฐ›๊ธฐ
git clone https://github.com/dunglas/mercure

๊นƒํ—ˆ๋ธŒ์—์„œ ํ”„๋กœ์ ํŠธ ์ฝ”๋“œ ์ „์ฒด๋ฅผ ๋‚ด ์ปดํ“จํ„ฐ๋กœ ๋‚ด๋ ค๋ฐ›์Šต๋‹ˆ๋‹ค.

cd mercure

๋ฐฉ๊ธˆ ๋‚ด๋ ค๋ฐ›์€ ํ”„๋กœ์ ํŠธ ํด๋” ์•ˆ์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

2. Docker

์‰ฌ์›€ ์ถ”์ฒœ
์‚ฌ์ „ ์ค€๋น„๋ฌผ
  • Git GitHub์—์„œ ํ”„๋กœ์ ํŠธ ์ฝ”๋“œ๋ฅผ ๋‚ด๋ ค๋ฐ›์œผ๋ ค๋ฉด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
  • Docker Desktop ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋นŒ๋“œํ•˜๊ณ  ์‹คํ–‰ํ•˜๋ ค๋ฉด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜ ํ›„ ์‹คํ–‰ํ•ด์„œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ์— ์ผœ๋‘์„ธ์š”.
docker build -t mercure .

Dockerfile์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ์ด๋ฏธ์ง€๋ฅผ ๋นŒ๋“œํ•ฉ๋‹ˆ๋‹ค.

docker run -p 8080:80 mercure

๋นŒ๋“œ๋œ ์ด๋ฏธ์ง€๋ฅผ ์‹ค์ œ ์ปจํ…Œ์ด๋„ˆ๋กœ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

โœ… ํ„ฐ๋ฏธ๋„์— docker compose ps ๋ฅผ ์ž…๋ ฅํ•ด ์ปจํ…Œ์ด๋„ˆ๋“ค์ด Up ์ƒํƒœ์ธ์ง€ ํ™•์ธํ•˜์„ธ์š”. README์— ํฌํŠธ ๋ฒˆํ˜ธ๊ฐ€ ์ ํ˜€์žˆ๋‹ค๋ฉด ๋ธŒ๋ผ์šฐ์ €์—์„œ http://localhost:ํฌํŠธ๋ฒˆํ˜ธ ๋กœ ์ ‘์†ํ•ด๋ณด์„ธ์š”.

3. Maven (Java)

๋ณดํ†ต
์‚ฌ์ „ ์ค€๋น„๋ฌผ
  • Git GitHub์—์„œ ํ”„๋กœ์ ํŠธ ์ฝ”๋“œ๋ฅผ ๋‚ด๋ ค๋ฐ›์œผ๋ ค๋ฉด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
  • JDK (Java) Java ํ”„๋กœ์ ํŠธ๋ฅผ ๋นŒ๋“œ/์‹คํ–‰ํ•˜๋ ค๋ฉด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
  • Maven mvn ๋ช…๋ น์–ด๋ฅผ ์“ฐ๊ธฐ ์œ„ํ•œ ๋นŒ๋“œ ๋„๊ตฌ์ž…๋‹ˆ๋‹ค.
cd gatling

์ด ํ”„๋กœ์ ํŠธ์˜ ๊ด€๋ จ ํŒŒ์ผ์ด ํ•˜์œ„ ํด๋” ์•ˆ์— ์žˆ์–ด์„œ, ๋จผ์ € ๊ทธ ํด๋”๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

mvn clean install

Maven์œผ๋กœ ์˜์กด์„ฑ ์„ค์น˜์™€ ๋นŒ๋“œ๋ฅผ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

โœ… BUILD SUCCESS ๋ฉ”์‹œ์ง€๊ฐ€ ๋œจ๋ฉด ์„ฑ๊ณต์ž…๋‹ˆ๋‹ค. target/ ํด๋”์— ๊ฒฐ๊ณผ๋ฌผ์ด ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

4. Node.js

์‰ฌ์›€
์‚ฌ์ „ ์ค€๋น„๋ฌผ
  • Git GitHub์—์„œ ํ”„๋กœ์ ํŠธ ์ฝ”๋“œ๋ฅผ ๋‚ด๋ ค๋ฐ›์œผ๋ ค๋ฉด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
  • Node.js npm ๋ช…๋ น์–ด๋ฅผ ์“ฐ๋ ค๋ฉด Node.js๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. LTS(์žฅ๊ธฐ์ง€์›) ๋ฒ„์ „์„ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค.
cd conformance-tests

์ด ํ”„๋กœ์ ํŠธ์˜ ๊ด€๋ จ ํŒŒ์ผ์ด ํ•˜์œ„ ํด๋” ์•ˆ์— ์žˆ์–ด์„œ, ๋จผ์ € ๊ทธ ํด๋”๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

npm install

package.json์— ๋ช…์‹œ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์„ ๋‚ด๋ ค๋ฐ›์•„ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

npm start

๊ฐœ๋ฐœ/์‹คํ–‰ ์„œ๋ฒ„๋ฅผ ์ผญ๋‹ˆ๋‹ค.

โœ… ๋ช…๋ น์–ด ์‹คํ–‰ ํ›„ ํ„ฐ๋ฏธ๋„์— ๋‚˜ํƒ€๋‚˜๋Š” ์ฃผ์†Œ(๋ณดํ†ต http://localhost:3000 ํ˜•ํƒœ)๋ฅผ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์—ด์–ด๋ณด์„ธ์š”.

5. Go

๋ณดํ†ต
์‚ฌ์ „ ์ค€๋น„๋ฌผ
  • Git GitHub์—์„œ ํ”„๋กœ์ ํŠธ ์ฝ”๋“œ๋ฅผ ๋‚ด๋ ค๋ฐ›์œผ๋ ค๋ฉด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
  • Go Go ์–ธ์–ด ์ปดํŒŒ์ผ๋Ÿฌ ๋ฐ ๋„๊ตฌ ๋ชจ์Œ์ž…๋‹ˆ๋‹ค.
cd caddy

์ด ํ”„๋กœ์ ํŠธ์˜ ๊ด€๋ จ ํŒŒ์ผ์ด ํ•˜์œ„ ํด๋” ์•ˆ์— ์žˆ์–ด์„œ, ๋จผ์ € ๊ทธ ํด๋”๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

go build ./...

Go ํ”„๋กœ๊ทธ๋žจ์„ ์ปดํŒŒ์ผํ•ด ์‹คํ–‰ ํŒŒ์ผ์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

go run .

๋”ฐ๋กœ ๋นŒ๋“œํ•˜์ง€ ์•Š๊ณ  ๋ฐ”๋กœ Go ํ”„๋กœ๊ทธ๋žจ์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

โœ… ๋นŒ๋“œ๊ฐ€ ์—๋Ÿฌ ์—†์ด ๋๋‚˜๋ฉด ์„ฑ๊ณต์ž…๋‹ˆ๋‹ค. go run . ์„ ์ผ๋‹ค๋ฉด ํ„ฐ๋ฏธ๋„ ์ถœ๋ ฅ์„ ํ™•์ธํ•˜์„ธ์š”.
// repository documentation