Comments (19)
Debug version of the player pops up dialog when Flash error happens. Some hints:
- Can you install Firebug and let me know what message is shown?
- Does Flash work in other sites?
- What's version of Flash Player?
- You can put console.log to some places in web_socket.js (and also to Flash implementation) to see which line of code it reached or not.
from web-socket-js.
And just for the record, I just tested on OSX/Firefox 3.6 and it works as expected. I'm using my Java WebSocket server to test with, not the Ruby one, but it's more likely something wrong in your setup.
Firstly, are you running the sample.html
file from a file:///
URI? That is allowed, you just need to add the path of the SWF file to Flash's Global Security settings first.
from web-socket-js.
Finally figured it out! The WebSocketMain.swf was being served, but in some strange encoding (I'm using a sort of homebrew NodeJS webserver, and it had only ever served text before, so I didn't notice). This broke the Flash file itself, which died silently.
Thanks for your help!
from web-socket-js.
Hi,
I'm using websocket.js and it worked good in Chrome but in Firefox and IE, WebSocket object created but it not connected to server ...
When i start FireBug, i see some errors:
[WebSocket] cannot connect to Web Socket server at ws://localhost:12345/ (SecurityError) make sure the server is running and Flash socket policy file is correctly placed webSocketError(Object { name="message"})web_socket.js (line 311)
[Break on this error] console.error(decodeURIComponent(message));\n
Whats the problem?
Thanks.
from web-socket-js.
Did you place Flash socket policy file in your server? See "Flash socket policy file" section of http://github.com/gimite/web-socket-js .
from web-socket-js.
Dear gimite,
I read it and i try to do that but i can't, i use PHP Server, can you please help me to place Flash socket policy files?
from web-socket-js.
Easiest way would be to run Perl script introduced at:
http://www.lightsphere.com/dev/articles/flash_socket_policy.html
in your server (referred in the "Flash socket policy file" section).
from web-socket-js.
Thanks dear gimite but i can't work with Perl, can i do this with PHP?
Is there any source for this?
Thanks.
from web-socket-js.
Hi again,
I put Flash socket policy file with Python and works good but after this step i get this error:
[WebSocket] cannot connect to Web Socket server at ws://localhost:1234/ (IoError)
[Break on this error] console.error(decodeURIComponent(message));\n
Whats the problem?
Thanks.
from web-socket-js.
It's most likely that the Web Socket server is not accessible. Does it really work fine with Chrome with same Web Socket URL still? Also your original email shows that you specified ws://localhost:12345/ but now it looks you specify ws://localhost:1234/ . Are you OK with that?
from web-socket-js.
Yes, it works in Chrome with ws://localhost:12345/ but with same URL it have problem with Firefox and IE.
May this error show because the Client and Server is the same?
from web-socket-js.
It should be OK if client and server is in the same host. But it doesn't work when you open the html file as local file i.e. file:///.../sample.html. Please open it via Web server. If you open it with http://... already, I have no idea...
from web-socket-js.
Thanks you dear gimite, it worked but now i have another problem.
When i start my WebSocket server and start Flash Policy file server, it try to connect to WebSocket server but connection not established and i can't send my messages to server. Here my headers:
[WebSocket] policy file: xmlsocket://172.16.17.211:843
[WebSocket] connected
[WebSocket] request header: GET / HTTP/1.1 Upgrade: WebSocket Connection: Upgrade Host: 172.16.17.211:8181 Origin: http://172.16.17.211 Cookie: PHPSESSID=eab33c48b3a1ab91d746f5268af223ec Sec-WebSocket-Key1: ;2 203 2 2130C 0 Sec-WebSocket-Key2: 4v 4 7 1 12 85_0
[WebSocket] sent key3: 8K<ðïÇ{~
[WebSocket] response header: HTTP/1.1 101 Web Socket Protocol Handshake Upgrade: WebSocket Connection: Upgrade WebSocket-Origin: http://172.16.17.211 WebSocket-Location: ws://172.16.17.211:8181/
When i try to send a message to server i see this error:
INVALID_STATE_ERR: Web Socket connection has not been established
And also WebServer show me that some body connected to server.
It worked in Safari and Chrome but in other browsers like FireFox nd IE i have this problem.
Thank you.
from web-socket-js.
Looks like your Web Socket server doesn't support new protocol. Web Socket protocol recently changed and web-socket-js follows new protocol. What Web Socket server are you using? Latest version of web-socket-ruby and em-web-socket supports new protocol. You should check if the server you are using has newer version supporting new protocol. In new protocol, server's response header includes "Sec-WebSocket-Origin" and "Sec-WebSocket-Location" instead of "WebSocket-Origin" and "WebSocket-Location".
from web-socket-js.
Yes, true.
When i change the Header to "Sec-..." i see nothing, web server also don't work with Firefox and IE, but in Safari i have no error.
from web-socket-js.
Also when i change headers to "Sec-..." after a few second i get this error:
[WebSocket] digest doesn't match: �server: other d != 3dAÀ�Cá�ÎiÀ×�$¾C
from web-socket-js.
Yeah the protocol update is not only about the header name. It also adds some security token exchange. If you use WebSocket server publicly available (e.g. em-websocket), it's likely that its latest version supports new protocol. If you implemented WebSocket server yourself, you should support new protocol yourself... See spec for details: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76
from web-socket-js.
Thank you dear gimite.
My WebSocket server based on .NET (and also in PHP) so how can i upgrade my protocol?
Is there any tutorial for this?
from web-socket-js.
I don't see any useful information other than the original spec: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76
It might be useful to read source code of other WebSocket servers. e.g. If you can read Ruby,
http://github.com/gimite/web-socket-ruby/blob/master/lib/web_socket.rb
might be useful.
from web-socket-js.
Related Issues (20)
- policy server file domain match error HOT 2
- Cant make it work even with perl socket policy server HOT 1
- Connection is closed before receiving all messages... HOT 2
- onmessage event doesn't happens when IE8 in normal mode, but works in F12 script debug mode O_o HOT 7
- Confirm the license version HOT 5
- Only variables should be passed by reference HOT 1
- IE9 Unable to connect websocket HOT 4
- Fetching policy file error connecting to wss endpoint HOT 4
- Edge browser support HOT 1
- don't work at ie 8 HOT 3
- ie8 and ie9 APPCRASH HOT 2
- IE8 下 自动关闭 HOT 2
- How to use web-socket-js with typescript? HOT 2
- Error during WebSocket handshake: Unexpected response code: 200 HOT 2
- IE8 can not connect to websocket HOT 2
- Real-time Collaborative editor HOT 1
- Can not open websocket when using https, but normal in http HOT 11
- Ie9 browser problem
- Show preview of html in new tab
- may help me? some one has this problem. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-socket-js.