Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to XHR in TTAPI? #93

Open
benschumacher opened this issue Sep 6, 2012 · 3 comments
Open

Fallback to XHR in TTAPI? #93

benschumacher opened this issue Sep 6, 2012 · 3 comments

Comments

@benschumacher
Copy link

Hey-

I was trying to use TTAPI on my network and it looks like there's a transparent proxy that's causing me headaches. I realize I can use a variety of means to work around this issue, but I also noticed that the Turntable's app falls back to using an XmlHttpRequest-based mechanism when these issues are encountered.

Is it possible to do the same in the TTAPI code? I'm trying to use the JavaScript version -- haven't spent much time looking at Ruby or Python.

Thanks!

@Izzmo
Copy link
Collaborator

Izzmo commented Sep 7, 2012

XmlHttpRequest is a browser based http request. The WebSocket class used in TTAPI will get down to this basic level of a connection if everything else fails.

@benschumacher
Copy link
Author

In my experience, it doesn't appear that the WebSocket class handles errors in such a way that it'll fallback to a poll-based mechanism. I've observed (via packet dump) a transparent proxy on my network returning a '504 Gateway Timeout' which ultimately leads to a complete failure in the TTAPI code -- it never attempts any other type of communication after encountering that error.

I haven't dug around in the WebSockets code enough to see if it should fallback -- I just assumed it didn't. I'll spend a little more time looking into this on my end, but would appreciate any guidance.

@Izzmo
Copy link
Collaborator

Izzmo commented May 23, 2013

My provider did not, at first, offer WebSockets, and thus it had to use long-polling (XHR) requests for all my bots, but I never updated the WebSocket class initially, and it all ran well. That is my only example of it working correctly and dropping down to XHR if WebSockets do not exist.

I didn't really look into it all that much though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants