From 684ddfd78d0a7370a6efd34020dbf6fd4cc2ffbc Mon Sep 17 00:00:00 2001 From: Philip Marais Date: Wed, 26 Sep 2018 07:25:25 +0200 Subject: [PATCH] Added connection variable for manual-connect Added the option to connect to a connection other than the connections dictated in the instantiation. Can be used as usual with `this.$connect()`, or alternatively `this.$connect('ws://localhost:port/foo/')` to specify a different socket endpoint/channel. --- src/Main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Main.js b/src/Main.js index 53ab66d..11812d2 100755 --- a/src/Main.js +++ b/src/Main.js @@ -13,7 +13,10 @@ export default { } if (opts.connectManually) { - Vue.prototype.$connect = () => { + Vue.prototype.$connect = (connectionAlternative) => { + if (connectionAlternative) { + connection = connectionAlternative + } observer = new Observer(connection, opts) Vue.prototype.$socket = observer.WebSocket }