Skip to content

Commit cf05fb3

Browse files
committed
.
1 parent 1e0fab3 commit cf05fb3

2 files changed

Lines changed: 20 additions & 14 deletions

File tree

src/components/Home.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default {
138138
};
139139
},
140140
mounted() {
141-
this.socket = io(websocket,['binary', 'base64']); // Use socket.io-client here instead of WebSocket
141+
this.socket = io(websocket,transports: ["websocket", "polling"]); // Use socket.io-client here instead of WebSocket
142142
this.socket.on('notification', (data) => {
143143
this.notifications.unshift({ ...data, timestamp: new Date() });
144144
this.showBrowserNotification(data.message);

webpack.config.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
module.exports = {
2-
devServer: {
3-
host: '0.0.0.0', // Allow external access
4-
port: 8080,
5-
client: {
6-
webSocketURL: {
7-
hostname: 'https://club-notification-backend.vercel.app', // Replace with your actual hostname
8-
port: 443, // Use HTTPS port
9-
pathname: '/ws',
10-
protocol: 'wss:', // Secure WebSocket
11-
},
2+
devServer: {
3+
host: "0.0.0.0", // Allow external access
4+
port: 8080,
5+
client: {
6+
webSocketURL: {
7+
hostname: "club-notification-backend.vercel.app", // Your backend domain
8+
port: 443, // HTTPS WebSocket
9+
pathname: "/socket.io/",
10+
protocol: "wss:", // Secure WebSocket
1211
},
13-
server: 'https', // Enable HTTPS
1412
},
15-
};
16-
13+
proxy: {
14+
"/socket.io/": {
15+
target: "https://club-notification-backend.vercel.app", // Backend URL
16+
ws: true, // Enable WebSocket proxying
17+
changeOrigin: true,
18+
},
19+
},
20+
server: "https", // Enable HTTPS
21+
},
22+
};

0 commit comments

Comments
 (0)