Skip to content

Commit

Permalink
fix: ws
Browse files Browse the repository at this point in the history
  • Loading branch information
hai-ko committed Oct 24, 2023
1 parent 3603bde commit 69100c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
25 changes: 14 additions & 11 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ http {
proxy_redirect off;
}

location /api/socket.io {
rewrite ^/api(.*)$ $1 break;
proxy_pass http://backend:8081/socket.io;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_set_header Host $host;
}

location /api {
rewrite ^/api(.*)$ $1 break;
limit_req zone=standardlimit burst=50;
Expand All @@ -58,16 +71,6 @@ http {
proxy_redirect off;
}

location /socket.io {
proxy_pass http://backend:8081/socket.io/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_set_header Host $host;
}

}
}
5 changes: 4 additions & 1 deletion packages/messenger-widget/src/components/DM3/DM3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ function DM3(props: Dm3Props) {
throw Error('Could not get account profile');
}

const socket = socketIOClient(deliveryServiceUrl, {
console.log('deliveryServiceUrl')
console.log(deliveryServiceUrl)

const socket = socketIOClient(, {
autoConnect: false,
transports: ['websocket'],
});
Expand Down

0 comments on commit 69100c2

Please sign in to comment.