Skip to content

Commit ffc545f

Browse files
authored
fix(frontend): wss on https (#639)
1 parent 0e95b8d commit ffc545f

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
## 开始使用
1818

19-
- Playground:[https://opendatalab.github.io/labelU-Kit/](https://opendatalab.github.io/labelU-Kit/)
20-
- 体验 LabelU 在线版[https://labelu.shlab.tech/](https://labelu.shlab.tech/)
19+
- [Playground](https://opendatalab.github.io/labelU/playground/image)
20+
- [LabelU 在线版](https://labelu.shlab.tech/)
2121

2222
## Packages
2323

README_en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
## Getting Started
1818

19-
- Playground: [https://opendatalab.github.io/labelU-Kit/](https://opendatalab.github.io/labelU-Kit/)
20-
- Try LabelU: [https://labelu.shlab.tech/](https://labelu.shlab.tech/)
19+
- [Playground](https://opendatalab.github.io/labelU/playground/image)
20+
- [LabelU online](https://labelu.shlab.tech/)
2121
- Documentation: [https://opendatalab.github.io/labelU-Kit](https://opendatalab.github.io/labelU-Kit)
2222

2323
## Packages

apps/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@
112112
"vite-plugin-svgr": "^2.4.0",
113113
"vite-plugin-ts-mono-alias": "^1.1.8"
114114
}
115-
}
115+
}

apps/frontend/src/hooks/useSampleWs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export default function useSampleWs() {
4343

4444
useEffect(() => {
4545
wsRef.current = new WebSocketClient(
46-
`ws://${host}/ws/task/${routeParams.taskId}/${routeParams.sampleId}?token=${token}`,
46+
`${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${host}/ws/task/${routeParams.taskId}/${
47+
routeParams.sampleId
48+
}?token=${token}`,
4749
);
4850

4951
const ws = wsRef.current;

0 commit comments

Comments
 (0)