P Philip Prins Active Member Licensed User Longtime User Aug 27, 2015 #1 I have a websocket server running , when using chrome on port 80 there is no problem but when i use Internet explorer 11 or Edge i get an error developed by the b4j ws script in regard to the WS Full path. b4j_ws = new WebSocket(fullpath); Syntax Error When i add a port number different then 80 Internet Explorer works fine. How can i solve this?
I have a websocket server running , when using chrome on port 80 there is no problem but when i use Internet explorer 11 or Edge i get an error developed by the b4j ws script in regard to the WS Full path. b4j_ws = new WebSocket(fullpath); Syntax Error When i add a port number different then 80 Internet Explorer works fine. How can i solve this?
Daestrum Expert Licensed User Longtime User Aug 28, 2015 #2 Are you running the server and client on the same machine, as reading through various posts, Edge does not allow web socket connections to the local machine. 127.0.0.1 and localhost appear to be no-no's. Upvote 0
Are you running the server and client on the same machine, as reading through various posts, Edge does not allow web socket connections to the local machine. 127.0.0.1 and localhost appear to be no-no's.
P Philip Prins Active Member Licensed User Longtime User Aug 28, 2015 #3 Daestrum said: Are you running the server and client on the same machine, as reading through various posts, Edge does not allow web socket connections to the local machine. 127.0.0.1 and localhost appear to be no-no's. Click to expand... No the server is running on a remote machine Upvote 0
Daestrum said: Are you running the server and client on the same machine, as reading through various posts, Edge does not allow web socket connections to the local machine. 127.0.0.1 and localhost appear to be no-no's. Click to expand... No the server is running on a remote machine
Erel B4X founder Staff member Licensed User Longtime User Aug 30, 2015 #4 What happens with FireFox? Can you get more information from the browser developer tools? Upvote 0
P Philip Prins Active Member Licensed User Longtime User Aug 30, 2015 #5 Hello Erel, The problem is only with IE when using port 80 ,the developer tools only mentions syntax error. Upvote 0
Hello Erel, The problem is only with IE when using port 80 ,the developer tools only mentions syntax error.
Erel B4X founder Staff member Licensed User Longtime User Aug 31, 2015 #6 It sounds like a bug in IE 11 / Edge. Upvote 0
R Roycefer Well-Known Member Licensed User Longtime User Sep 11, 2015 #7 It's kinda/sorta a bug in IE 11. Firefox and Chrome are just more flexible in interpreting URLs. The problem is IE 11 doesn't like URLs of the form "ws://domain.tdl:/WebSocketHandler". That colon without a specified port number trips it up. I changed this line in b4j_ws.js Code: Copy fullpath = ((l.protocol === "https:") ? "wss://" : "ws://") + l.hostname + ":" + l.port + absolutePath; to this Code: Copy var portString = (l.port==="") ? l.port : (":" + l.port); fullpath = ((l.protocol === "https:") ? "wss://" : "ws://") + l.hostname + portString + absolutePath; and now it works with and without specified port numbers in Chrome, IE 11 and Firefox. Upvote 0
It's kinda/sorta a bug in IE 11. Firefox and Chrome are just more flexible in interpreting URLs. The problem is IE 11 doesn't like URLs of the form "ws://domain.tdl:/WebSocketHandler". That colon without a specified port number trips it up. I changed this line in b4j_ws.js Code: Copy fullpath = ((l.protocol === "https:") ? "wss://" : "ws://") + l.hostname + ":" + l.port + absolutePath; to this Code: Copy var portString = (l.port==="") ? l.port : (":" + l.port); fullpath = ((l.protocol === "https:") ? "wss://" : "ws://") + l.hostname + portString + absolutePath; and now it works with and without specified port numbers in Chrome, IE 11 and Firefox.