chromium/third_party/blink/web_tests/external/wpt/fetch/private-network-access/resources/socket-opener.html

<!DOCTYPE html>
<meta charset="utf-8">
<title>WebSocket Opener</title>
<script>
  window.addEventListener("message", function (event) {
    const socket = new WebSocket(event.data);

    socket.onopen = () => {
      parent.postMessage("open", "*");
    };
    socket.onclose = (evt) => {
      parent.postMessage(`close: code ${evt.code}`, "*");
    };
  });
</script>