diff options
Diffstat (limited to 'testing/web-platform/tests/fetch/private-network-access/resources/socket-opener.html')
-rw-r--r-- | testing/web-platform/tests/fetch/private-network-access/resources/socket-opener.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fetch/private-network-access/resources/socket-opener.html b/testing/web-platform/tests/fetch/private-network-access/resources/socket-opener.html new file mode 100644 index 0000000000..48d27216be --- /dev/null +++ b/testing/web-platform/tests/fetch/private-network-access/resources/socket-opener.html @@ -0,0 +1,15 @@ +<!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> |