8000 Preserve websocket server IP over reloading the web page. · micropython/webrepl@03492fe · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 03492fe

Browse files
anlumoPaul Sokolovsky
authored andcommitted
Preserve websocket server IP over reloading the web page.
1 parent 8096cd6 commit 03492fe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

webrepl.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@
9797

9898
(function() {
9999
window.onload = function() {
100+
var url = window.location.hash.substring(1);
101+
if (url) {
102+
document.getElementById('url').value = 'ws://' + url;
103+
}
100104
var size = calculate_size(self);
101105
term = new Terminal({
102106
cols: size[0],
@@ -149,6 +153,7 @@
149153
}
150154

151155
function connect(url) {
156+
window.location.hash = url.substring(5);
152157
ws = new WebSocket(url);
153158
ws.binaryType = 'arraybuffer';
154159
ws.onopen = function() {

0 commit comments

Comments
 (0)
0