MWSE/internal/httpserver
abdussamedulutas 28abefaaa9 Frontend TS→JS ES modülleri + #42 codec altyapısı + versiyon握手
SDK (sdk/ dizini — native ES module, bundler yok):
- sdk/version.js      : SDK_VERSION="1.0.0", CODEC_JSON/BINARY sabitleri
- sdk/codec.js        : WSTSCodec — JSON (şu an), binary stub (#42 altyapısı)
  Binary çerçeveleme: opcode(1B)+length(4B)+payload; şimdilik NotImplemented fırlatır
- sdk/EventTarget.js  : MWSEEventTarget (browser EventTarget ile çakışma yok)
- sdk/Connection.js   : endpoint:"auto" → import.meta.url ile sunucu tespiti
- sdk/WSTSProtocol.js : codec üzerinden encode/decode, sinyal yönlendirme
- sdk/EventPool.js    : request()/only() ayrımı (#33 korunuyor)
- sdk/Peer.js         : WebRTC stub bağlantısı, WOM pack/to (#33)
- sdk/Room.js         : WOM pack/room (#33), createRoom/join/eject
- sdk/PeerInfo.js, RoomInfo.js, IPPressure.js, P2PFileSender.js
- sdk/WebRTC.js       : placeholder — ayrıca ele alınacak
- sdk/index.js        : MWSE ana sınıfı + versiyon el sıkışması

Versiyon el sıkışması (backend ↔ frontend zorunlu):
- internal/protocol/version.go  : WSTSVersion="1.0.0", WSTSCodecJSON=0
- internal/services/yourid.go   : bağlantı anında wsts/hello sinyali gönderir
  (v + codecs listesi; id sinyalinden ÖNCE gelir)
- sdk/index.js _awaitHello()    : scope çalıştırılmadan önce wsts/hello beklenir;
  versiyon uyuşmazsa bağlantı kapatılır + 'error' eventi ateşlenir (5s timeout)

Servis (httpserver):
- /sdk.js  → 301 /sdk/index.js  (import.meta.url doğru çözümlenir)
- /sdk/    → sdk/ dizini file server
- internal/config: MWSE_SDK_DIR env değişkeni (varsayılan ./sdk)

Demo dosyaları: public/demos/{chat,audio,video}.html
go test -race ./... yeşil

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 12:24:21 +03:00
..
api.go #46: 3. parti sunucu köprüsü (bridge) 2026-06-17 12:05:59 +03:00
contract_test.go #32: SDK ↔ Go engine I/O sözleşmesi doğrulama harness'i 2026-06-17 08:16:34 +03:00
httpserver.go Frontend TS→JS ES modülleri + #42 codec altyapısı + versiyon握手 2026-06-17 12:24:21 +03:00
util.go Go engine portu (0.1.0 çekirdek) — Node.js engine'i race-free Go'ya taşı 2026-06-17 07:09:36 +03:00