corrections
This commit is contained in:
parent
14ab240398
commit
276f0c63dd
@ -1,3 +1,3 @@
|
|||||||
NEXT_PUBLIC_HOSTNAME=192.168.1.18
|
NEXT_PUBLIC_HOSTNAME=192.168.1.18
|
||||||
PORT=8000
|
NEXT_PUBLIC_PORT=8000
|
||||||
NEXT_PUBLIC_HOST=http://$NEXT_PUBLIC_HOSTNAME:$PORT
|
NEXT_PUBLIC_HOST=http://$NEXT_PUBLIC_HOSTNAME:$NEXT_PUBLIC_PORT
|
@ -30,6 +30,7 @@ export default function RoomPage({ id_code, user }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isConnected == false && isBrowser) {
|
if (isConnected == false && isBrowser) {
|
||||||
|
console.log('CONNECTED')
|
||||||
connect("/ws/room/" + id_code);
|
connect("/ws/room/" + id_code);
|
||||||
send({
|
send({
|
||||||
data: {
|
data: {
|
||||||
|
@ -16,9 +16,11 @@ export const WebsocketProvider = ({ children }) => {
|
|||||||
if (isBrowser) {
|
if (isBrowser) {
|
||||||
|
|
||||||
var url = url.startsWith('/')? url: '/' + url
|
var url = url.startsWith('/')? url: '/' + url
|
||||||
|
console.log(
|
||||||
|
`ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}`
|
||||||
|
);
|
||||||
ws.current = new ReconnectingWebSocket(
|
ws.current = new ReconnectingWebSocket(
|
||||||
`ws://${process.env.NEXT_PUBLIC_HOST}:${process.env.NEXT_PUBLIC_PORT}${url}`
|
`ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}`
|
||||||
);
|
);
|
||||||
|
|
||||||
ws.current.onopen = () => {
|
ws.current.onopen = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user