<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kiririmode</author_name>
  <author_url>https://blog.hatena.ne.jp/kiririmode/</author_url>
  <blog_title>理系学生日記</blog_title>
  <blog_url>https://kiririmode.hatenablog.jp/</blog_url>
  <categories>
    <anon>wsl</anon>
    <anon>network</anon>
  </categories>
  <description>以前の記事で、WSL2は「別マシン」だと書きました。VMとして独立していて、Windowsとは明確な壁がある。 WSL2でWebサーバを起動すると、Windowsのブラウザからlocalhost:3000で普通にアクセスできる。別マシンなのに、なぜlocalhostで繋がるのか？ 矛盾してません？ 僕も最初混乱しました。「WSL2とWindowsが同じlocalhostを共有しているのか？」と。ところが逆方向だとそうではない。Windows側で起動したサーバに、WSLからlocalhostでアクセスしようとすると、届きません。 この挙動は、WSL2のNATネットワーキングモードと、Micros…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkiririmode.hatenablog.jp%2Fentry%2F20260102%2F17179246901339456166&quot; title=&quot;WindowsからWSL2のサーバへlocalhostでアクセスできる仕組みと片方向性の理由 - 理系学生日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/k/kiririmode/20260102/20260102134524_original.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-01-02 13:46:00</published>
  <title>WindowsからWSL2のサーバへlocalhostでアクセスできる仕組みと片方向性の理由</title>
  <type>rich</type>
  <url>https://kiririmode.hatenablog.jp/entry/20260102/17179246901339456166</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
