chore(ChatWindow): 🔧 add auto protocol
This commit is contained in:
parent
a8f5d4d50b
commit
74cd7d586d
1 changed files with 2 additions and 2 deletions
|
@ -145,8 +145,8 @@ const ChatWindow = () => {
|
|||
const publicPort = typeof window !== 'undefined' && window.location.port;
|
||||
const publicUrl = `${publicHostname}${publicPort ? `:${publicPort}` : ''}`;
|
||||
const publicProtocol = typeof window !== 'undefined' && window.location.protocol;
|
||||
const wsProtocol = publicProtocol === 'https:' ? 'wss:' : 'ws:';
|
||||
const webSocketUrl = process.env.NEXT_PUBLIC_WS_URL || `${wsProtocol}://${publicUrl}/ws`;
|
||||
const wsProtocol = publicProtocol === 'https:' ? 'wss://' : 'ws://';
|
||||
const webSocketUrl = process.env.NEXT_PUBLIC_WS_URL || `${wsProtocol}${publicUrl}/ws`;
|
||||
const ws = useSocket(webSocketUrl, setIsReady);
|
||||
|
||||
const [chatHistory, setChatHistory] = useState<[string, string][]>([]);
|
||||
|
|
Loading…
Add table
Reference in a new issue