Skip to content

Commit

Permalink
[IMP] demo: Allow access to the session/transporservice on local network
Browse files Browse the repository at this point in the history
closes #5383

Task: 0
Signed-off-by: Pierre Rousseau (pro) <[email protected]>
  • Loading branch information
rrahir committed Dec 26, 2024
1 parent 0f45915 commit 0ed70d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ topbarMenuRegistry.addChild("clear", ["file"], {
name: "Clear & reload",
sequence: 10,
execute: async (env) => {
await fetch("http://localhost:9090/clear");
await fetch(`http://${window.location.hostname}:9090/clear`);
document.location.reload();
},
icon: "o-spreadsheet-Icon.CLEAR_AND_RELOAD",
Expand Down Expand Up @@ -308,7 +308,7 @@ class Demo extends Component {
* @returns {Promise}
*/
async fetchHistory() {
const result = await fetch("http://localhost:9090");
const result = await fetch(`http://${window.location.hostname}:9090`);
return result.json();
}
}
Expand Down
2 changes: 1 addition & 1 deletion demo/transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class WebsocketTransport {
*/
connect() {
return new Promise((resolve, reject) => {
const socket = new WebSocket(`ws://localhost:9090`);
const socket = new WebSocket(`ws://${window.location.hostname}:9090`);
socket.addEventListener("open", () => {
this.socket = socket;
this.isConnected = true;
Expand Down

0 comments on commit 0ed70d2

Please sign in to comment.