I have written an application in DHTML using OpenLaszlo. The application works perfectly fine in Chrome, but it is having problems in Firefox. The javascript client makes HTTP POST requests to a Struts2 middle layer, which queries the database via Hibernate and then returns an XML response. The application is in production, so the client code, middle layer and database are all hosted on my desktop machine.
I can literally run the application in Chrome and Firefox side-by-side, and while everything works perfectly in Chrome, a few of the HTTP requests (the same ones every time) will fail on Firefox. The ones that fail do so immediately after the POST request is initiated, with no HTTP response or error code given (I am using Firebug to watch the POST requests and responses).
After watching the traffic with Wireshark I have determined that, for some reason, Firefox is sending a FIN ACK packet immediately (less than a second) after making the POST request and receiving the standard ACK from the server.
The network traffic looks like this:
In Chrome: Client sends POST -> Server sends ACK -> Server sends XML data -> Client sends ACK -> Server sends HTTP/XML 200 Response -> Client sends ACK
In Firefox: Client sends POST -> Server sends ACK -> Client sends FIN, ACK -> Server sends ACK -> Server sends XML data -> Client sends a reset
I am wondering if anyone has witnessed this type of behavior before, and might know what I can do to fix it.
i also encountered this issue. Firefox send FIN,ACK related to its new network change feature. see: https://hg.mozilla.org/mozilla-central/rev/0a066b7ffa46
we spend huge time in checking this.
i have also an post at stackoverflow: when firefox 38 sent FIN,ACK after server ack an http get from firefox?
for anyone interested in this, please track: bugzilla.mozilla.org/show_bug.cgi?id=1245059 workaround solution is to set "network.http.network-changed.timeout” setting bigger. check our reported firefox bug for more detail.
Related
I am running a node application which uses the request lib to access playlist information from soundcloud. On my local machine, this works without a hitch, but on my ubuntu server it does not. What's more, it was working before and has only recently stopped working. All other HTTP requests leaving my server are executing just fine.
I have heard that this could be due to request limits, but I have specifically constructed my app in such a way that it is only calling to the API once every 5 minutes which is well-below the 15,000 request limit per 24 hours. Additionally, I should probably be receiving a 429 error code if that were the case, as per soundcloud docs
https://developers.soundcloud.com/docs/api/rate-limits#play-requests
The 500 error i'm getting is incredibly non-specific:
<html><body><h1>500 Server Error</h1>
An internal server error occured.
</body></html>
Here is what my request looks like:
https://api.soundcloud.com/users/<user_id>/tracks?client_id=<my_client_id>&offset=1&order=created_at&created_at={from: 2016/02/22 05:45:31 +0000}
where both the user_id and the my_client_id are correctly populated. If i take the same URL and print it into my web browser ur a wget from my local machine, i have no problems.
This seems to be resolved by Soundcloud internally. Not sure what was causing it.
I have a web application that uses WebSockets to communicate between browser and server. When serving as ws, everything works as intended. If I change the protocol to wss, things mostly work as expected (the majority of messages passed from client to server, or vice versa, are received), but I occasionally one of the following errors in the Chrome console:
"Could not decode a text frame as UTF-8."
or
"Invalid frame header"
...at which point Chrome releases the connection.
I have observed this both when serving wss directly from the server (runs on .NET, uses SuperWebSocket), and in a configuration where the server uses ws and Apache's mod_proxy_wstunnel to reverse proxy to this using the wss protocol. I have also set up a simple "echo" server under the same Apache configuration, and don't observe the issue; this leads me to believe there's something funny about the data we're passing to the SuperWebSocket API. (The messages which cause the error are valid UTF-8, and again, don't see this issue when serving over ws.)
I'm at a loss for how a protocol change would cause such an issue to occur, which leads me to my question:
Are there cases where a WebSocket frame might be valid when sent without TLS but would become corrupted when sent with TLS?
Are there cases where a WebSocket frame might be valid when sent without TLS but would become corrupted when sent with TLS?
No, wss:// is the same as ws:// only that it is not using plain TCP but TCP+TLS. The WebSockets protocol itself is not aware if it is running inside a plain TCP connection or a TLS protected TCP connection. This is similar to https:// vs. http://.
But a TLS connection is more sensible to data corruption. That is if some man in the middle modifies the packets properly simple ws:// will not notice while wss:// will croak because the modification of the packet was detected. But you should get the error then at the connection level (i.e. connection broke or similar) and not at the WebSockets level like in your case (invalid frame header).
I have no idea what you are running as a WebSockets backend but I would suggest that the problem lies there. Because of the additional TLS layer wss:// might behave slightly different regarding timing and buffering of data inside the server so there might be a race conditions which happens more likely when wss:// is in use compared to ws://.
Ok so for the TCP client in DroidScript, what do I do so that it can receive data from the server at any moment?
The example that is provided shows receiving once only after sending data to the server.
How would i set it up to receive data from the server at any given moment?
I have already tried: net.SetOnReceive and nothing has happened, though i have confirmed data is being sent from the server to the app.
I have also tried net.ReceiveText but I've only received one input from server... but no more after that.
So if anyone could please help?
Screenshot of code:
http://js.x10.bz/ss/i/ZNCj.png
DroidScript TCP sockets are client only (not server). Try using a WebSockets instead and check on the DroidScript forum here:-
https://groups.google.com/d/msg/androidscript/t1QzCgGZrH8/0S8xYbByjNsJ
I'm trying to use web sockets to connect from a Google Chrome browser on my phone to a server running node.js and socket.io.
Using the remote debugging tool in Google Chrome I get this error in the console
Failed to load resource http://localhost/socket.io/1/?t=1368744562638
This happens despite me specifying my internal LAN IP in code for the client like so:
var socket = io.connect('http://192.168.1.3');
Furthermore it seems like the first heartbeat request makes it but starts to fail after that.
The code runs as expected when running the client on the server.
I am of course a idiot. I had another javascript file that had not been updated to connect to the specific IP I had set and was still set to "localhost".
After updating the host that socket.io should connect to in that javascript file everything is now running smoothly :)
I am trying to connect browsers with a server that provides Server Sent Events (SSE). This server has a different domain than the original one. For example if you call http://d1.example.com/page this page will try to connect to an SSE channel on http://d2.example.com/subscribe. Trying to do that will prompt the following error:
Uncaught Error: SECURITY_ERR: DOM Exception 18
on the line:
var source = new EventSource("http://d2.example.com/subscribe")
How can I fix that?
Update (Solutions that I have tried out):
1- CORS
I tried CORS by adding Access-Control-Allow-Origin:* to the headers of my web service d2.example.com. It did not solve EventSource problem, even though $.get("http://d2.example.com") calls from d1.example.com pages are working fine now! I thought SSE works on normal HTTP requests, so why is it not working on Chrome?
2- Redirect
I am using httpd server, so I created a redirect rule in d1.example.com virtual host that passes SSE requests to d2.example.com. It worked perfectly with Firefox. Chrome on the other hand did not prompt any error and did not connect to the SSE server either. It looks like it dumped the whole EventSource command. It looks like this solution will never work, so lets move on...
3- Reverse proxy
Both browsers connected on d1.example.com/subscribe which is basically connecting to d2.example.com through reverse proxy. But on_close event is never caught, even if the browser is closed. Which makes sense since the d2 server is now making the channel with the proxy server. How can I forward the on_close event from proxy server to d2?
Is there any different ways that could make this work?
The odds are high this is an issue of cross-origin resource sharing, which you must enable on the relevant domains.
http://enable-cors.org/
As the MDN says:
Note: Although it's not yet part of the standard, EventSource supports CORS in Firefox 11 and later. This is expected to become standard soon.