Skip to content

fix(socket): SockJS 생성자에 wss:// 대신 https:// 전달 (실시간 연결 복구) - #38

Merged
lsmin3388 merged 1 commit into
mainfrom
fix/sockjs-url
Jun 8, 2026
Merged

fix(socket): SockJS 생성자에 wss:// 대신 https:// 전달 (실시간 연결 복구)#38
lsmin3388 merged 1 commit into
mainfrom
fix/sockjs-url

Conversation

@lsmin3388

Copy link
Copy Markdown
Contributor

증상

실시간(문제 수신·참가자 목록·시작 전환 등)이 동작하지 않음.

원인

new SockJS(ENV.WS_URL) 에 주입된 wss://144-24-92-17.sslip.io/ws 가 그대로 전달됨. SockJS 생성자는 http(s) 베이스 URL 을 기대하므로 wss:// 는 연결 실패.

  • 서버 엔드포인트는 정상: GET https://.../ws/info → 200, {"websocket":true}

수정

toSockJsUrl()wss→https, ws→http 변환 후 SockJS 에 전달. NEXT_PUBLIC_WS_URL 환경변수는 그대로 둠.

pnpm tsc --noEmit ✅ · pnpm build

- new SockJS(ENV.WS_URL) 에 wss://... 가 그대로 전달돼 연결 실패 → SockJS 는 http(s) 베이스 URL 필요
- toSockJsUrl 로 wss→https, ws→http 변환 후 전달 (NEXT_PUBLIC_WS_URL 환경변수는 그대로 유지)
- 서버 SockJS 엔드포인트(/ws/info)는 https 200·websocket:true 로 정상 확인됨
@lsmin3388
lsmin3388 merged commit 3894519 into main Jun 8, 2026
@lsmin3388
lsmin3388 deleted the fix/sockjs-url branch June 8, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant