VS Code の拡張機能 Share Code は、LAN内の他のPCとリアルタイムでコードを共有・編集できるツールです。
ホストPCがサーバーとなり、クライアントは接続してリアルタイムにコードを確認できます。
主な機能
リアルタイムでコードを共有・同期
LAN 内でサーバー・クライアント接続が可能
WebSocket 経由で双方向通信
クライアントは自動で1秒ごとに最新コードを取得
サーバーの起動や接続はワンクリックで簡単操作
使い方
🔹 インストール
VS Code Marketplace または .vsix ファイルから拡張機能をインストールしてください。
🔹 モード選択(ホスト / クライアント)
🔸 ホスト側
VS Code を開く
コマンドパレット(Ctrl+Shift+P)で Start Sharing を実行
モードで「ホスト(サーバ起動)」を選択し、サーバを起動
表示される IP アドレス(例: 192.168.0.10:3000)をクライアントに共有
🔸 クライアント側
同じく Start Sharing を実行
モードで「クライアント(接続)」を選択
ホストの IP アドレスを入力して接続
クライアントは毎秒、ホストから最新コードを取得します。
利用シーン例
ペアプログラミング
コードレビュー
学習・講義での画面共有
ハッカソンでの素早い共有
必要条件
同一ネットワーク上のPC同士(LAN接続)
ポート 3000 を使用(Firewall の許可が必要な場合あり)
ライセンス
Copyright (c) Taiki Matsumura, Chiba University
All rights reserved.
Share Code Extension
Share Code is a VS Code extension that allows you to share and edit code in real-time across multiple machines on the same LAN.
The host machine starts a local WebSocket server, and client machines can connect to view or edit code live.
Features
Real-time code sharing and synchronization
Peer-to-peer connection over LAN
Bi-directional communication using WebSocket
Client pulls latest code every second
One-click setup for hosting or joining a session
How to Use
🔹 Installation
Install this extension via the VS Code Marketplace or using a local .vsix file.
🔹 Mode Selection (Host / Client)
🔸 Host
Open VS Code
Open Command Palette (Ctrl+Shift+P) and run Start Sharing
Select “Host (Start Server)” mode and start the server
Share the displayed IP address (e.g., 192.168.0.10:3000) with the client
🔸 Client
Open Start Sharing from Command Palette
Select “Client (Connect)” mode
Enter the host's IP address and connect
The client automatically fetches the latest code from the host every second.
Use Cases
Pair programming
Code reviews
Teaching or live coding sessions
Rapid collaboration at hackathons
Requirements
Devices must be on the same local network (LAN)
Uses port 3000 (ensure it is not blocked by a firewall)
License
Copyright (c) Taiki Matsumura, Chiba University
All rights reserved.