Skip to content

Preserve websocket server IP over reloading the web page. #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions webrepl.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@

(function() {
window.onload = function() {
var url = window.location.hash.substring(1);
if(url) {
document.getElementById('url').value = 'ws://' + url;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure this requires a different (consistent) indent to be merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole window.onload method is using 2 space indent when the rest of the javascript is using 4 spaces. When fixing this, also fix the indenting on onload method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole window.onload method is using 2 spaces, and so all indents should use 2 spaces, not 1, like patch above. Changing unrelated things is always the worst solution. Please leave it as is, maintainers will clean it all up (when have a time).

}
var size = calculate_size(self);
term = new Terminal({
cols: size[0],
Expand Down Expand Up @@ -134,6 +138,7 @@
}

function connect(url) {
window.location.hash = url.substring(5);
ws = new WebSocket(url);
ws.binaryType = 'arraybuffer';
ws.onopen = function() {
Expand Down