Merge pull request #939 from revolunet/patch-1

fix: fix #918
This commit is contained in:
Mark Nadal 2020-05-16 01:56:12 -07:00 committed by GitHub
commit 0af7379ed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
gun.js
View File

@ -2413,7 +2413,7 @@
mesh.wire = opt.wire = open;
function open(peer){ try{
if(!peer || !peer.url){ return wire && wire(peer) }
var url = peer.url.replace('http', 'ws');
var url = peer.url.replace(/^http/, 'ws');
var wire = peer.wire = new opt.WebSocket(url);
wire.onclose = function(){
opt.mesh.bye(peer);