Skip to content

Commit

Permalink
show transport in example apps
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed May 15, 2021
1 parent 6a2463c commit 044e9c0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions example/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
var start_time;
window.setInterval(function() {
start_time = (new Date).getTime();
$('#transport').text(socket.io.engine.transport.name);
socket.emit('my_ping');
}, 1000);

Expand Down Expand Up @@ -87,8 +88,11 @@
</head>
<body>
<h1>Flask-SocketIO Test</h1>
<p>Async mode is: <b>{{ async_mode }}</b></p>
<p>Average ping/pong latency: <b><span id="ping-pong"></span>ms</b></p>
<p>
Async mode is: <b>{{ async_mode }}</b><br>
Current transport is: <b><span id="transport"></span></b><br>
Average ping/pong latency: <b><span id="ping-pong"></span>ms</b>
</p>
<h2>Send:</h2>
<form id="emit" method="POST" action='#'>
<input type="text" name="emit_data" id="emit_data" placeholder="Message">
Expand Down

0 comments on commit 044e9c0

Please sign in to comment.