FIX websocket wss location bug

This commit is contained in:
Jasder 2020-07-02 18:22:54 +08:00
parent a037820905
commit 3f117cddfa
1 changed files with 3 additions and 3 deletions

View File

@ -196,11 +196,11 @@ class Detail extends Component {
})
}
canvasChannel = () => {
const name = window.location.hostname === "localhost" ? "http://testforgeplus.trustie.net":window.location.hostname;
console.log(`wss:${name}/cable`);
const name = window.location.hostname === "localhost" ? "testforgeplus.trustie.net":window.location.hostname;
console.log(`wss://${name}/cable`);
const actioncable = require("actioncable")
var project = this.state.project
var cable = actioncable.createConsumer(`wss:${name}/cable`);
var cable = actioncable.createConsumer(`wss://${name}/cable`);
this.canvasChannel1 = cable.subscriptions.create({
channel: `MirrorProjectChannel`,
id: project && project.identifier