Skip to content
Open
Changes from all commits
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
4 changes: 3 additions & 1 deletion templates/paste.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@

function subscribeToPastes() {

var exampleSocket = new WebSocket("ws://{{host}}:{{port}}/subscriptions");
// Same-origin URL built in the browser: no server bind address/port is rendered into the page.
var wsScheme = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
var exampleSocket = new WebSocket(wsScheme + window.location.host + '/subscriptions');

exampleSocket.onopen = function () {
var query = 'subscription getPaste {paste { id title content ipAddr userAgent public owner {name} } }';
Expand Down
Loading