Skip to content

Commit 6f73ca5

Browse files
committed
Implemented socket.io changes for Mac platform, removed unnecessary css file
1 parent d4d300e commit 6f73ca5

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

desktop-helper-sample/helper/public/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ const startServer = async () => {
1111

1212
const io = new Server(server, {
1313
cors: {
14-
origin: 'http://localhost:3000',
14+
origin: '*',
1515
methods: ['GET'],
16+
transports: ['websocket'],
1617
},
1718
});
1819

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React, { createContext } from 'react';
22
import io from 'socket.io-client';
33

4-
export const socket = io('http://localhost:4040');
4+
export const socket = io('http://localhost:4040', {
5+
transports: ['websocket'],
6+
});
57

68
export const SocketContext = createContext();

desktop-helper-sample/uxp/plugin/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<link rel="stylesheet" href="index.css" />
54
<script src="./index.js"></script>
65
<style>
76
.container {

desktop-helper-sample/uxp/src/index.css

Lines changed: 0 additions & 8 deletions
This file was deleted.

desktop-helper-sample/uxp/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ entrypoints.setup({
1313
},
1414
});
1515

16-
let socket = io('http://localhost:4040');
16+
let socket = io('http://localhost:4040', {
17+
transports: ['websocket'],
18+
});
1719

1820
// Attempt to reconnect if server isn't running
1921
socket.on('connect_error', () => {

0 commit comments

Comments
 (0)