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

websockets with dapr #5766

Closed
lokeshcloudy opened this issue Jan 16, 2023 · 5 comments
Closed

websockets with dapr #5766

lokeshcloudy opened this issue Jan 16, 2023 · 5 comments
Labels
stale Issues and PRs without response

Comments

@lokeshcloudy
Copy link

Hi, currently im using azure container apps for our application deployment with dapr we are using react as frontend and nodejs as backend. hear im facing a issue with websocket invoke all the api's are working fine but websocket connections are not working fine, the connection is getting created but in next few seconds its getting disconnected. below is config file of nginx where routing is configured

server {
listen 5002;
listen [::]:5002;
server_name default_server;

location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    try_files $uri  /index.html;
}

location /ws {
            proxy_pass http://localhost:3500/v1.0/invoke/backend/method/ws;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
            proxy_set_header Host $host;
    }


location /api/v1 {
    proxy_pass http://localhost:3500/v1.0/invoke/backend/method/api/v1;
}
@ItalyPaleAle
Copy link
Contributor

Thanks for the report.

At this time, Dapr's service invocation cannot be used with WebSockets. We have quite a lot of work to do before we can support that, starting with #5706 which won't support WebSockets but lays some foundations (and doesn't even complete the E2E project).

In the meanwhile, if you need to proxy a stream of data, your best option would be to convert it to a gRPC bi-directional stream, which can be proxied through Dapr.

@dapr-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added the stale Issues and PRs without response label Mar 21, 2023
@dapr-bot
Copy link
Collaborator

This issue has been automatically closed because it has not had activity in the last 67 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions.

@dapr-bot dapr-bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2023
@olitomlinson
Copy link

In light of the amazing work that @ItalyPaleAle is doing with #6571, once this is complete will we be any closer to being able to support websockets?

If there are other blockers after #6571 is complete, what might they be?

@ItalyPaleAle
Copy link
Contributor

@olitomlinson I'd say we are inching closer, but we're still far from being able to support websockets.

The work that rolls up to #6571 helps by having converted the server to net/http.

However, the work above was focused on the internal messaging, which is still designed for unary RPCs: a client sends a request and a server responds. It is not designed to support two-way communication.

Websocket support may possibly be built on top of the gRPC proxying feature. We could convert it to a gRPC duplex stream internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues and PRs without response
Projects
None yet
Development

No branches or pull requests

4 participants