Skip to content

Commit

Permalink
Don't cardcode websocket ip
Browse files Browse the repository at this point in the history
  • Loading branch information
sidoh committed Oct 20, 2024
1 parent 0dc459c commit 22d1c4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web2/lib/websocket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ const WebSocketContext = createContext<WebSocketContextType | null>(null);
export const WebSocketProvider: React.FC<{ children: ReactNode }> = ({
children,
}) => {
const { lastJsonMessage, sendJsonMessage } =
useWebSocket(`ws://10.133.8.88:81`);
const { lastJsonMessage, sendJsonMessage } = useWebSocket(
`ws://${window.location.host}:81`
);
const [messages, setMessages] = useState<WebSocketMessage[]>([]);

useEffect(() => {
Expand Down

0 comments on commit 22d1c4b

Please sign in to comment.