LoginSignup
7
6

More than 5 years have passed since last update.

VSCodeのLive ShareでFailed to create a collaboration session. となる場合の対処(Proxy環境下)

Last updated at Posted at 2018-05-09

はじめに

Visual Studio Live Share が先日パブリックプレビューとなりました。
https://code.visualstudio.com/visual-studio-live-share

早速 Visual Studio Code で試めそうと思い、Proxy 環境下で Share をおこなったところ以下のメッセージが

image.png

Failed to create a collaboration session. An error occurred while sending the request.

拡張機能のインストールもできているので、VSCode 自体の Proxy 設定は問題ないはず。。

環境

  • OS: Windows
  • VSCode: 1.23.0

対応方法

ユーザ環境変数またはシステム環境変数に HTTPS_PROXY を設定し、VSCode を再起動するだけでした。

image.png

共有が成功し、招待リンクがクリップボードにコピーされました。

補足

Live Share機能には複数のコネクションモードが用意されています。

Connectivity requirements for Live Share
https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/connectivity

デフォルトは Auto で 自動的に Direct モードと Relay モードを切り替えて接続を試行します。
VSCode の場合、何れのモードでも以下のアウトバウントアクセスが必要です。

  • download.microsoft.com:443
  • download.visualstudio.microsoft.com:443

Relay モードはクラウド経由でホストマシンとゲストマシンを接続しますが、
更に以下のアウトバウントアクセスが必要です。

  • *.servicebus.windows.net:443.

私の環境では VSCode の User Settings(settings.json)で http.proxy のみを設定していましたが、
上記の HTTPS 通信については Proxy を経由できていないため、エラーとなっていたようです。
環境変数に明示的に HTTP_PROXY/HTTPS_PROXY を設定すれば、
Visual Studio Live Share はそちらの設定を参照します。

以上です。
参考になれば幸いです。

おまけ

Live Share の準備

VSCode で Live Share 機能を使用するには以下が必要です。

  • VSCode 1.22.0 以上
  • 拡張機能のインストール

image.png

MARKETPLACEで live share と検索するか、こちらのページからインストールできます。
https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare

拡張機能をインストールし、再読込を行うと、画面下部に Sign in が表示されます。

image.png

こちらを選択すると、ブラウザでサインイン画面が開きます。
マイクロソフトアカウント または GitHubアカウントを使用してサインインします。

image.png

image.png

サインインが成功し、Share ボタンが表示されれば準備完了です。

image.png

7
6
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
7
6