Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

public signaling servers down? #43

Closed
Lukap22 opened this issue Feb 16, 2023 · 10 comments
Closed

public signaling servers down? #43

Lukap22 opened this issue Feb 16, 2023 · 10 comments
Labels

Comments

@Lukap22
Copy link

Lukap22 commented Feb 16, 2023

Hallo,

My app cannot connect to ['wss://signaling.yjs.dev', 'wss://y-webrtc-signaling-eu.herokuapp.com', 'wss://y-webrtc-signaling-us.herokuapp.com']
image

A few weeks back this wasn't the case.

Code used:

import { WebrtcProvider } from "y-webrtc";
import { Doc } from "yjs";

const doc = new Doc();

export const webrtcProvider = new WebrtcProvider(
  "vZ#4h2%60$1H",
  doc,
  { password: "wMrg3@4WVf^q@iK6xukh@86&fCY5GmvX" }
);

export const disconnect = () => webrtcProvider.disconnect();
export const connect = () => webrtcProvider.connect();

// Get the provider's awareness API
export const awareness = webrtcProvider.awareness;

import { Avatar, Divider, Grid, Stack, Tooltip } from "@mui/material";
import ActionDialog from "@src/components/ActionDialog";
import { MIconButton } from "@src/components/minimals/@material-extend";
import useAuth, { User } from "@src/hooks/useAuth";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { useParams } from "react-router";
import { useUsers } from "y-presence";

export type YUser = User & { name: string, orderId: number | null };
export type UseUsers = Map<number, YUser>;
import { awareness } from "../syncedStores/orderSyncedStore";

export default function SyncedUsers({ order_id }: { order_id: number }) {
  const { t: dashboardT } = useTranslation("dashboard");
  const { user } = useAuth();
  const {id} = useParams()
  console.log("synced",{id})

  useEffect(() => {
    if (user && id) {
      const yUser: YUser = {
        name: `${user.first_name} ${user.last_name}`,
        ...user,
        orderId : Number(id),
      };
      awareness.setLocalState(yUser);
    }
  }, [id, user]);

  const users = useUsers(awareness) as UseUsers;
  const orderUsers = Array.from(users.entries()).filter(
    ([_, u]) => u.orderId !== order_id && u.id !== user?.id
  );
  
  return (
    <>
      <Stack gap={2} direction={"row"} ml={"auto"}>
        {orderUsers.map(([_, value]) => {
          return <YUserAvatar key={value.id} user={value} />;
        })}
      </Stack>
      {orderUsers.length >= 1 && (
        <ActionDialog title={dashboardT("warning")} open={true}>
          {dashboardT("there_are_other_users_in_this_order")}
        </ActionDialog>
      )}
    </>
  );
}

export function YUserAvatar({ user }: { user: YUser }) {
  const { t: commonT } = useTranslation("common");
  return (
    <ActionDialog
      title={`${user.name}`}
      openButton={(setOpen) => (
        <Tooltip title={user.name}>
          <MIconButton
            onClick={() => setOpen(true)}
            sx={{
              padding: 0,
              width: 44,
              height: 44,
            }}
          >
            <Avatar
              alt="User avatar"
              sx={{
                mx: "auto",
                bgcolor: "primary.main",
                color: "text.primary",
              }}
            >
              {user.first_name.slice(0, 1)}
              {user.last_name.slice(0, 1)}
            </Avatar>
          </MIconButton>
        </Tooltip>
      )}
    >
      <Grid container>
        <Grid item xs={3}>
          Email
        </Grid>
        <Grid item xs={9}>
          {user.email}
        </Grid>
        <Divider />
        <Grid item xs={3}>
          Rol
        </Grid>
        <Grid item xs={9}>
          {commonT(user.role)}
        </Grid>
        <Divider />
      </Grid>
    </ActionDialog>
  );
}

I would like to deploy my own signaling server but find the tuturial to be unclear. Could anyone help me with this?

@benatkin
Copy link

The demo here isn't working https://docs.yjs.dev/getting-started/a-collaborative-editor

Why the wontfix tag?

@Lukap22
Copy link
Author

Lukap22 commented Feb 21, 2023

The demo here isn't working https://docs.yjs.dev/getting-started/a-collaborative-editor

Why the wontfix tag?

I accidentally added it and I can't seem to remove it. But the demo is working on the website on the website, right? On stackblitz I get errors though.

@moklick
Copy link

moklick commented Mar 2, 2023

I get the same errors.. Probably some heroku foo 🥲

@laem
Copy link

laem commented Mar 6, 2023

Yes, all 3 default servers are down for me too.

image

@djmaze
Copy link

djmaze commented Mar 11, 2023

Also bitten by this. Time to set up independent servers it seems..

@Dammic
Copy link

Dammic commented Mar 16, 2023

Hey! We also have a problem with that - it's not critical for us as we've used that only for some local development and we are in the middle of migrating to private signaling server. But I guess could be nice to resolve if feasible 😄

As for having a private signaling server, there is an example server in ./bin folder, which works fine and I think can be used out of the box.

Thanks for your hard work on this library!

@laem
Copy link

laem commented Mar 16, 2023

Yes, booting the server on e.g. scalingo.com is very easy :)

@dmonad dmonad closed this as completed in 818140c Mar 16, 2023
@dmonad
Copy link
Member

dmonad commented Mar 16, 2023

Sorry for the long wait. I couldn't decide on the next server after switching several times because they all went broke / failed regularly / changed focus. I went with fly.io. I'm sorry fly.io, because of my luck you will probably go down as well.

@yousefamar
Copy link

Not sure if this is worth opening a new issue, but it seems y-webrtc-eu.fly.dev is down?

@benatkin
Copy link

Sorry for the long wait. I couldn't decide on the next server after switching several times because they all went broke / failed regularly / changed focus. I went with fly.io. I'm sorry fly.io, because of my luck you will probably go down as well.

Not bad luck, Fly.io was never very reliable to begin with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants