1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Media over QUIC Transportのmoq-wasmを動かす

Last updated at Posted at 2024-11-06

※2024/11現在。未プルリク

以下のものをWindows11環境で動かす

Windows11のバージョン

  • windows11 24H2 26100.2161

環境のインストール

Node.js / Cargo / wasm-packが入ってること

Node.js

※この時は v23.1.0 を利用

Cargo

wasm-packのinstall

Cargoをインストール後に以下のコマンドを実行

cargo install wasm-pack

実行

  1. git clone
  2. readmeの通りだが以下の修正
    • opensslのコマンドで'を"に変更
  3. package.jsonを以下の変更
    • RUSTFLAGSの環境変数を設定方法を変更
    RUSTFLAGS=--cfg=web_sys_unstable_apis
    
    SET RUSTFLAGS=--cfg=web_sys_unstable_apis && 
    
  4. もろもろインストール&起動
  5. chromeの起動時に以下のbatを使い自己証明をあてた形で起動する
    ※現状のbatはChromeを新規で立ち上げないといけないため既存に立ち上がってるchrome.exeは落とすかkillしてから起動する必要がある
    echo off
    setlocal enabledelayedexpansion
    
    echo Starting localhost test in Chrome
    
    openssl x509 -pubkey -noout -in "%~dp0../moqt-server-sample/keys/cert.pem" | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary > "%~dp0.tmp"
    certutil -encode "%~dp0.tmp" "%~dp0.out" >NUL
    for /f %%i in ('findstr /b /c:"-" /v "%~dp0.out"') do set certbase64=%%i
    del "%~dp0.tmp" "%~dp0.out"
    
    set /A num=0
    for /f "tokens=2 delims= " %%i in ('tasklist /fi "imagename eq chrome.exe"') do set /A num=num+1
    if %num% gtr 1 (
        echo [ERROR] Chrome is already running. please close all chrome.exe.
        exit /b
    ) else (
        echo Starting Chrome
        start chrome --auto-open-devtools-for-tabs --test-type --origin-to-force-quic-on=localhost:4433 --ignore-certificate-errors-spki-list=!certbase64! --use-fake-device-for-media-stream --new-window http://localhost:5173/
    )
    
    
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?