2017-06-03 12 views
0

go http/2プッシュで再生を開始しています。 リクエストはhttp/2です(Firefoxでは「Version:HTTP/2.0」が表示され、サーバーでhttp/2を使用しているかどうかを確認する拡張子があります)。 はしかし、のようなもの:HTTP/2要求ですが、サポートしていません

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 
    if pusher, ok := w.(http.Pusher); ok { 
     // Push is supported. 
     if err := pusher.Push("/app.js", nil); err != nil { 
      log.Printf("Failed to push: %v", err) 
     } 
    } else { 
     fmt.Println("Push not supported") 
    } 
    // ... 
}) 

は、必ず "サポートされていないプッシュ" が表示されます。 それをデバッグするためのヒント?

おかげ

+0

を、とにかくプッシュしようと、私はパニックを取得:2017-06-03_01: 05:22.85073 CSSを押す-------------------- 2017-06-03_01:05:22.85087 2017/06/03 01:05:22 http2:パニックサービング172.18 .0.1:43268:ランタイムエラー:無効なメモリアドレスまたはnilポインタ参照解除 2017-06-03_01:05:22.85088 goroutine 86 [実行中]: 2017-06-03_01:05:22.85088 net/http。(* http2serverConn)。 runHandler.func1(0xc42000c038、0xc42015ffaf、0xc420133880) 2017-0 6-03_01:05:22.85090 /usr/local/Cellar/go/1.8.3/libexec/src/net/http/h2_bundle.go:4604+ 0x190 – Gravis

+0

アサーションを無視することは、動作しないことが保証されています。 – Adrian

答えて

関連する問題