Skip to content

Commit ed6ec22

Browse files
committed
Added Flow.edit(proxy_socket_url) method for the remote editing of the FlowStream.
1 parent 68de332 commit ed6ec22

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- improved compiling navigation in the CMS compiler
2121
- fixed filling of the `template` property in the CMS compiler
2222
- added a new method `U.aistreamer(on_line, on_message)`
23+
- added `Flow.edit(proxy_socket_url)` method for the remote editing of the FlowStream
2324

2425
========================
2526
0.0.15

flow-flowstream.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,21 @@ Instance.prototype = {
9696
}
9797
};
9898

99+
Instance.prototype.edit = function(proxy_socket_url = 'wss://flow.totaljs.com/{0}/') {
100+
101+
let instance = this;
102+
103+
if (instance.$remoteclient)
104+
instance.$remoteclient.destroy();
105+
106+
return WEBSOCKETCLIENT(function(client) {
107+
instance.$remoteclient = client;
108+
client.connect(proxy_url.format(instance.id));
109+
Flow.client(instance, client);
110+
});
111+
112+
};
113+
99114
Instance.prototype.postMessage = function(msg) {
100115
if (this.flow.postMessage) {
101116
// Try & Catch handles unexpected problems with the main process becoming disconnected.

0 commit comments

Comments
 (0)