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. Python

쉬움
사전 μ€€λΉ„λ¬Ό
  • Git GitHubμ—μ„œ ν”„λ‘œμ νŠΈ μ½”λ“œλ₯Ό λ‚΄λ €λ°›μœΌλ €λ©΄ ν•„μš”ν•©λ‹ˆλ‹€.
  • Python 3 μ„€μΉ˜ μ‹œ 'Add Python to PATH' μ˜΅μ…˜μ„ κΌ­ μ²΄ν¬ν•˜μ„Έμš” (Windows).
pip install -r examples/chat/requirements.txt

requirements.txt 등에 λͺ…μ‹œλœ 파이썬 라이브러리λ₯Ό μ„€μΉ˜ν•©λ‹ˆλ‹€.

python <μ‹€ν–‰ν•  파일λͺ…>.py # READMEμ—μ„œ μ •ν™•ν•œ μ‹€ν–‰ 파일λͺ…을 ν™•μΈν•˜μ„Έμš”

파이썬 슀크립트(λ˜λŠ” λͺ¨λ“ˆ)λ₯Ό μ‹€ν–‰ν•©λ‹ˆλ‹€.

βœ… μ—λŸ¬ λ©”μ‹œμ§€ 없이 μ‹€ν–‰λ˜κ³  터미널에 μ•ˆλ‚΄ 문ꡬ가 좜λ ₯되면 μ •μƒμž…λ‹ˆλ‹€.

6. Go

보톡
사전 μ€€λΉ„λ¬Ό
  • Git GitHubμ—μ„œ ν”„λ‘œμ νŠΈ μ½”λ“œλ₯Ό λ‚΄λ €λ°›μœΌλ €λ©΄ ν•„μš”ν•©λ‹ˆλ‹€.
  • Go Go μ–Έμ–΄ 컴파일러 및 도ꡬ λͺ¨μŒμž…λ‹ˆλ‹€.
cd caddy

이 ν”„λ‘œμ νŠΈμ˜ κ΄€λ ¨ 파일이 ν•˜μœ„ 폴더 μ•ˆμ— μžˆμ–΄μ„œ, λ¨Όμ € κ·Έ ν΄λ”λ‘œ μ΄λ™ν•©λ‹ˆλ‹€.

go build ./...

Go ν”„λ‘œκ·Έλž¨μ„ μ»΄νŒŒμΌν•΄ μ‹€ν–‰ νŒŒμΌμ„ λ§Œλ“­λ‹ˆλ‹€.

go run .

λ”°λ‘œ λΉŒλ“œν•˜μ§€ μ•Šκ³  λ°”λ‘œ Go ν”„λ‘œκ·Έλž¨μ„ μ‹€ν–‰ν•©λ‹ˆλ‹€.

βœ… λΉŒλ“œκ°€ μ—λŸ¬ 없이 λλ‚˜λ©΄ μ„±κ³΅μž…λ‹ˆλ‹€. go run . 을 썼닀면 터미널 좜λ ₯을 ν™•μΈν•˜μ„Έμš”.
// repository documentation