Skip to content

Commit

Permalink
tracer: Avoid hardcoding the WebSocket port
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Sep 19, 2024
1 parent 662d2d5 commit ab9ed88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/tracer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default function App() {
const [addingTargets, setAddingTargets] = useState(false);
const [events, setEvents] = useState<Event[]>([]);
const [stagedItems, setStagedItems] = useState<StagedItem[]>([]);
const { sendJsonMessage, lastJsonMessage, readyState } = useWebSocket<TracerMessage>("ws://localhost:1337" /* window.location.origin */);
const { sendJsonMessage, lastJsonMessage, readyState } = useWebSocket<TracerMessage>(
(import.meta.env.MODE === "development")
? "ws://localhost:1337"
: `ws://${window.location.host}`);

function handleHandlerSelection(id: HandlerId) {
setSelectedHandler(id);
Expand Down

0 comments on commit ab9ed88

Please sign in to comment.