-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.html
78 lines (78 loc) · 3.08 KB
/
client.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!doctype html>
<html lang="en">
<title>WebTransport over HTTP/3 client</title>
<meta charset="utf-8">
<script src="client.js"></script>
<link rel="stylesheet" href="client.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<div id="top">
<div id="explanation">
This tool can be used to connect to an arbitrary WebTransport server.
It has several limitations:
<ul>
<li>It can only send an entirety of a stream at once. Once the stream
is opened, all of the data is immediately sent, and the write side of
the steam is closed.</li>
<li>This tool does not listen to server-initiated bidirectional
streams.</li>
<li>Stream IDs are different from the one used by QUIC on the wire, as
the on-the-wire IDs are not exposed via the Web API.</li>
<li>The <code>WebTransport</code> object can be accessed using the developer console via <code>currentTransport</code>.</li>
</ul>
</div>
<div id="tool">
<h1>WebTransport over HTTP/3 client</h1>
<div>
<h2>Establish WebTransport connection</h2>
<div class="input-line">
<label for="url">URL:</label>
<input type="text" name="url" id="url"
value="https://localhost:4443/publish">
<input type="button" id="connect" value="Connect" onclick="connectHandler()">
<input type="button" id="add_client" value="Add Client" onclick="AddClient()">
</div>
</div>
<div>
<h2>Send data over WebTransport</h2>
<form name="sending">
<textarea name="data" id="data"></textarea>
<div>
<input type="radio" name="sendtype" value="datagram"
id="datagram" checked>
<label for="datagram">Send a datagram</label>
</div>
<div>
<input type="radio" name="sendtype" value="unidi" id="unidi-stream">
<label for="unidi-stream">Open a unidirectional stream</label>
</div>
<div>
<input type="radio" name="sendtype" value="bidi" id="bidi-stream">
<label for="bidi-stream">Open a bidirectional stream</label>
</div>
<input type="button" id="send" name="send" value="Send data"
disabled onclick="sendDataHandler()">
<div>
<label for="autotest-count">Auto test group count:</label>
<input type="number" id="autotest-count" name="autotest-count" min="1" value="2048">
</div>
<input type="button" id="autotest" name="autotest" value="Auto test"
disabled onclick="AutoTest()">
<input type="button" id="mutiple_client_test" name="mutiple_client_test" value="Mutiple Client Test"
disabled onclick="MutipleClientTest()">
<input type="button" id="clear" name="clear" value="Clear log"
onclick="clearLog()">
<input type="button" id="close" name="close" value="Close"
onclick="closeTransport()">
</form>
</div>
<div>
<h2>Event log</h2>
<ul id="event-log"></ul>
<div id="state-log"></div> <!-- State log -->
</div>
</div>
</div>
</div>
</body>
</html>