I'm trying to use javascript to make a websocket request from a local test.dev
page to a server running at ip 123.123.123.123
on behalf of test.com
. The request goes through, but the 123.123.123.123
server sees the Origin: test.dev
header in the websocket request and rejects the connection because it wants to see Origin: test.com
.
Here is the javascript code for connecting the socket:
ws = new WebSocket(123.123.123.123);
How can I use javascript to start a websocket connection with a dishonest Origin
header of Origin: test.com
?
I was hoping something like this would work, but I can't find any such:
ws = new WebSocket(123.123.123.123, test.com);