So i am using the tutorial here to setup my socket.io connection using Angular 5.x
There are two scenarios happening and im not sure why one is working and one isnt, so im hoping someone can assist.
Failing Scenario
1) Launch my WS Server using Boost::Beast CPP library on server IP 10.1.1.1, using the chrome plugin "Simple WebSocket Client" i connect to my server IP address, it connects through the HTTP handler of Beast, see's it as a Websocket upgrade request, and spawns my websocket session and works and connects as expected. I am modifying my HTTP request to set ALLOW-ACCESS-CONTROL-ORIGIN and other flags to deal with CORS issues blocking my Angular client currently i just have it forced to allow http://localhost:4200, although i planned on changing that to just echo back the IP of the client, unsure if that is part of the problem im having honestly.
In case it matters here are the request items im adding
res.insert(boost::beast::http::field::access_control_allow_origin, "http://localhost:4200");
res.insert(boost::beast::http::field::access_control_allow_methods, "GET, POST, OPTIONS, PUT, PATCH, DELETE");
res.insert(boost::beast::http::field::access_control_allow_headers, "X-Requested-With,content-type");
res.insert(boost::beast::http::field::access_control_allow_headers, "X-Requested-With,content-type");
Here are the response/request/general for the failing case
https://i.stack.imgur.com/ZqHKr.jpg
Working scenario
1) Launch my WS Server using Boost::Beast CPP library on server. Using Socket.Io for Angular5. Its basically a blank angular-cli project and in the app component i do
this.socket = socketIo('10.1.1.1:8087').
Although i have also tried the following after looking at some other issues people have had trying to force SocketIO to just go straight into websocket mode and not do other http transactions.
this.socket = socketIo({transports: ['websocket'], upgrade: false}, '10.1.1.1:8087');
What results is not the same as the working case, the request seems to be the same, but it never triggers my websocket upgrade request code in Beast, and the connection is never made as far as i can tell.
Here is the request/response/general for the failing case https://i.stack.imgur.com/4j0sL.jpg
Again i feel like it has something to do with the fact that the Chrome plugin is connecting directly to the IP address of the server, where when i am connecting through my angular project its sending Localhost:4200 as the origin, not the client machines actual IP address?
Any help would be greatly appreciated.