mirror of
https://github.com/yudai/gotty.git
synced 2025-09-21 21:40:49 +02:00
Authenticate WS connection using token
Safari doesn't support basic authentication for websocket sessions. This commit introduces a token-based authentication only for websocket connection. The token is shared by all clients and that might be not secure. However, basic authentication itself is insecure and the credential is already shared by clients, so don't mind.
This commit is contained in:
parent
e7e607b3d7
commit
0e81c484a9
4 changed files with 47 additions and 34 deletions
|
@ -10,6 +10,8 @@
|
|||
var term;
|
||||
|
||||
ws.onopen = function(event) {
|
||||
ws.send(gotty_auth_token);
|
||||
|
||||
hterm.defaultStorage = new lib.Storage.Local();
|
||||
hterm.defaultStorage.clear();
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<body>
|
||||
<div id="terminal"></div>
|
||||
<script src="./js/hterm.js"></script>
|
||||
<script src="./auth_token.js"></script>
|
||||
<script src="./js/gotty.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue