This commit is contained in:
parent
6ec444cc14
commit
e47bb01fb3
@ -24,21 +24,21 @@ export const useTetherWS = (
|
|||||||
* Establish a connection with the API.
|
* Establish a connection with the API.
|
||||||
*/
|
*/
|
||||||
function connect() {
|
function connect() {
|
||||||
socket = new WebSocket(url); // Connect to the gateway
|
socket = new WebSocket("wss://usetether.rest/gateway"); // Connect to the gateway
|
||||||
socket.addEventListener("open", () =>
|
socket.addEventListener("open", () =>
|
||||||
console.log("[Tether] WebSocket connection established!")
|
console.log("[Tether] WebSocket connection established!")
|
||||||
);
|
);
|
||||||
socket.addEventListener("close", connect);
|
// socket.addEventListener("close", connect);
|
||||||
|
//
|
||||||
socket.addEventListener("message", (event) => {
|
// socket.addEventListener("message", (event) => {
|
||||||
console.log("data:", event.data);
|
// console.log("data:", event.data);
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
connect();
|
connect();
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
return () => {
|
return () => {
|
||||||
socket.removeEventListener("close", connect);
|
// socket.removeEventListener("close", connect);
|
||||||
socket.close();
|
socket.close();
|
||||||
};
|
};
|
||||||
}, [url]);
|
}, [url]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user