Issue
It's perfectly working for Http, but not for WebSocket. I did not find the documentation about this. How can I do proxy for WS?
ng serve --proxy-config proxy.conf.json
proxy.conf.json:
{
"/": {
"target": "http://localhost:8080",
"secure": false
}
}
Solution
Angular cli uses http-proxy-middleware
for proxy under the hood. take a look at the documentation: https://github.com/chimurai/http-proxy-middleware
there is a websocket ws
boolean option you can use as described in this section:
https://github.com/chimurai/http-proxy-middleware#http-proxy-options
so you can change your config to:
{
"/": {
"target": "http://localhost:8080",
"secure": false,
"ws":true
}
}
Answered By - Ahmed Musallam
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.