🍊
Tailscaleで,リモートPCのviteまたはwebpack開発サーバーに簡単にアクセスしたい
結論
- tailscaleの設定(ポート番号は任意のものを設定)
sudo tailscale serve --bg --https=443 3000
- webpack.jsonまたはvite.config.tsに以下を追加
- webpack
devServer: { host: '0.0.0.0', allowedHosts: 'all', },
- vite
server: { host: true, // 開発サーバをネットワーク上に公開するかどうか allowedHosts: ["リモートPCのホスト名"], },
- webpack
https://リモートPCのホスト名
にアクセスできるはずだ.
環境
リモートPC: mac mini
ローカルPC: windows11
両者にtailscaleをインストールして設定済み.
背景
リモートPCにsshしてweb開発しているときのこと.tailscaleを活用して開発サーバにhttpsでアクセスしたいだけなのに,502 Bad Gatewayを出される.
Discussion