Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
- Fixed bug where remote was sending the whole client not just the name.
- Added port to local-webui join form on production.
  • Loading branch information
ohuu committed May 4, 2021
1 parent 88efc55 commit e1475bd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion local-webui/src/components/Join.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import { clientName, registerUiWithRemote } from "../hooks/useRemote";
const REMOTE_SERVER_URL =
process.env.NODE_ENV === "production"
? "http://46.101.24.208"
? "http://46.101.24.208:3000"
: "http://127.0.0.1:3000";
export default defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion local/src/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function getRemoteWs(url?: string): Promise<Socket> {
});
});

remoteWs.on("remote/become/sender", (to: string) => {
remoteWs.on("remote/become/sender", (_to: string) => {
logger.info("becoming sender");
if (isSending) {
// TODO: send message to UI with details
Expand Down
3 changes: 2 additions & 1 deletion local/src/rxadapters/rxUdp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export function observerToUdp(
): Rx.Observer<{ from: string; data: Buffer }> {
return {
next: ({ from, data }) => {
if (sender !== undefined || from === sender) {
logger.info(`from = ${from}, sender ${sender}`);
if (from === sender) {
if (debug)
logger.info(
`from ${from} sending to ${address}:${port}, data ${data.byteLength}`
Expand Down
4 changes: 2 additions & 2 deletions remote/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ io.on("connection", (socket) => {
clientMap.push([fromClient, toClient]);

// send message to 'from' to set up as a sender
io.to(fromClient.socketId).emit("remote/become/sender", toClient);
io.to(fromClient.socketId).emit("remote/become/sender", toClient.name);

// send message to 'to' to setup as a receiver
io.to(toClient.socketId).emit("remote/become/receiver", fromClient);
io.to(toClient.socketId).emit("remote/become/receiver", fromClient.name);

// send the client list and mappings to all UIs
io.in("ui_room").emit("remote/state", { clients, clientMap });
Expand Down

0 comments on commit e1475bd

Please sign in to comment.