-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] An insecure WebSocket connection may not be initiated from a page loaded over HTTPS #7701
Comments
I sent a similar problem before, but did not find a solution after # 3007 (install a plug-in). |
Thanks for reaching out again. To be honest my answer in your last issue is still accurate #7651 (comment) - if you can't wait for 1.5 or make your connection use a secure protocol then either the websocket plugin or the localhost plugin are the only workarounds. So the only help i can provide is to help you make one of them work but for that i'd need to know what exactly you tried and the problems you were facing, thanks :) Closing this issue so the team knows that it's not a bug they have to work on, but we can keep talking in here! |
According to the website (https://github.com/tauri-apps/plugins-workspace/tree/v1/plugins/localhost) method using localhost plugin, According to the sample will be tauri - plugin - localhost = {git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1"} Portpicker = "0.1" used in the example to randomly select a freeport to add to cargo.toml and in main. The code in Rs has been changed, and the program crashes after executing cargo run。 Before this is my code:
, including key_event, mouse_event. Generate_account is my own definition of the function.But according to the example code copy in the past after the program flash back, do not know what is the reason |
Ok, thank you! |
Describe the bug
Mixed Content: The page at 'https://tauri.localhost/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://10.22.234.122:8080/conn/e6888a85d1b24d1f855e7ffbc67005ee'. This request has been blocked; this endpoint must be available over WSS.
Reproduction
No response
Expected behavior
No response
Platform and versions
Stack trace
Additional context
This is my websocket code, how should I change it?I'm pretty bad at this, so I need some guidance. If there's any additional information you need, please let me know
const initWebSocket = () => {
ws = new WebSocket(ws://10.22.234.122:8080/conn/${data.account.id});
ws.onopen = (e: Event) => {
setInterval(() => {
sendToServer({
msg_type: "heartbeat",
receiver: "",
sender: "",
msg: "",
});
}, 1000 * 60);
};
ws.onmessage = async (e: MessageEvent) => {
const msg: Record<string, any> = JSON.parse(e.data);
switch (msg.msg_type) {
case MessageType.VIDEO_OFFER: // Invitation and offer to chat
handleVideoOfferMsg(msg);
break;
case MessageType.VIDEO_ANSWER: // Callee has answered our offer
handleVideoAnswerMsg(msg);
break;
case MessageType.NEW_ICE_CANDIDATE: // A new ICE candidate has been received
handleNewICECandidateMsg(msg);
break;
case MessageType.REMOTE_DESKTOP:
handleRemoteDesktopRequest(msg);
break;
case MessageType.CLOSE_REMOTE_DESKTOP:
close();
break;
}
};
ws.onerror = (e: Event) => {
console.log("conn error");
};
};
The text was updated successfully, but these errors were encountered: