Comments (24)
@seiyria In your console do:
npm remove -g socketcluster
then
npm cache clean
Then follow these steps exactly:
http://socketcluster.io/#!/docs/getting-started
from socketcluster-client.
I did that exactly, see my project here (it's pretty minimal so far).
from socketcluster-client.
@seiyria Did you run the socketcluster create myappname
command afterwards?
from socketcluster-client.
@jondubois No, I ran that to generate the project shown above, then I removed the server / serve-static part of it as this will just be a dedicated backend (the frontend is an app).
from socketcluster-client.
@seiyria So you don't want SC to serve the client file (socketcluster.js) - You want to serve it from somewhere else?
from socketcluster-client.
@jondubois Yes, I was under the impression that it was a client and the client could be served from anywhere else. Based on your reaction, I suspect that won't work so well. I suppose I could serve just the js file from there and have the app include it, but I prefer to not have external assets (I think Apple has a policy against that, so my app would probably get rejected).
from socketcluster-client.
That is possible - You can get the client separately and serve it up from anywhere, but it's a bit trickier to setup (manual). Did you use the socketcluster.js file that is inside socketcluster-client/ repo?
from socketcluster-client.
Yeah, I've tried that as well. My basic code to reproduce was above. It didn't seem to establish a connection.
from socketcluster-client.
@seiyria Note sure if that could explain the problem but I noticed that there was an outdated socketcluster.js client inside the socketcluster/sample/ app - This was an accident - I removed that file from the module on npm. You should only use the one from the https://github.com/TopCloud/socketcluster-client repo.
from socketcluster-client.
Absolutely, that's the one I was using.
from socketcluster-client.
What OS are you using?
from socketcluster-client.
I'm on OSX for dev. Originally, I tried hosting the server on my linux VM on my windows machine across the network, but I eventually moved it all to my OSX machine to eliminate possible network problems as a cause (though once I have something working I will revisit getting that working).
from socketcluster-client.
Is your HTTP server running on the same host/domain as the socketcluster server?
from socketcluster-client.
Yes, currently it is. I'm trying to establish the connection via localhost:8000
.
from socketcluster-client.
What do you get when you run socketcluster -v
?
from socketcluster-client.
Oh, wait, shoot. Something I'll have to take a look at later, actually, I don't think it is. It's running in the iOS simulator, which simulates a device. localhost
would probably refer to that device, not the host machine. That doesn't explain why it couldn't connect when given a specific IP, though.
Sorry, this might be a total non-issue; I didn't even think about that. I'll try to resolve this when I'm at my machine next.
Thanks for your support so far!
from socketcluster-client.
Ok. Let me know.
Thanks for reporting.
If in doubt, raise an issue :)))
from socketcluster-client.
Hey, so I double checked. Apparently iOS simulator uses the host network, ie, localhost
definitely refers to the machine currently running the server.
from socketcluster-client.
So you didn't manage to get it working on any platform? Did you try to run on Windows directly?
It would be interesting to know what's causing this. I might play around with serving the file from a different origin than the SC server just to see what happens - This should be supported by default though.
from socketcluster-client.
I have not (I actually have no development tools available to me on windows by design).
It'd be difficult for me to run it all in just linux, as well, as I was unable to get the android simulator working and I can't get the ios simulator on it, so that unfortunately leaves me stuck on OSX. My project is an Ionic app, I should also add. I don't know if that makes a difference though.
Sure, I mean if it works for you, I'm probably screwing something up, but .. who knows.
from socketcluster-client.
@seiyria I noticed in your first post, you mentioned an 'xhr poll' error - This suggests that you are using version 1.x.x of the client and not the latest 2.x.x version. Could you be using the SC1 client with the SC2 server? The two versions have the same external API but are protocol-incompatible.
Unfortunately, the version number isn't anywhere in the client script (yet) - But to check you can open the socketcluster.js client file and search for the string 'engine.io' - If there are any matches, then it means that you are using v1 of the client.
If that's the issue, make sure you do npm cache clean
and then npm install socketcluster-client
then get the socketcluster.js file from there - This will be version 2.
npm packages and git branches for SC1 and SC2 have moved around about one or two weeks ago so this could have caused cache issues with npm.
Maybe that's the issue.
from socketcluster-client.
Absolutely, thank you. I will give this a try when I get back and let you know the results. I was out of ideas!
from socketcluster-client.
Ah, I figured out why. I bower installed your repo, but you never pushed tags to it, so I got 0.9. I'll try now and see if it works!
from socketcluster-client.
Yep, and it definitely works now! Thanks for pointing that out. When you attend to #7, make sure you push all your tags :P
Thanks a ton!
from socketcluster-client.
Related Issues (20)
- socketCluster client on the backend
- Increases temperature on ios devices HOT 2
- TypeError: cb is not a function HOT 8
- Update release Page HOT 1
- Not able to run the client on the office-js in excel desktop HOT 2
- Subscribe method causes error in IE11 HOT 9
- TypeError: _iterator[Symbol.iterator] is not a function || For await of loop not working on Mobile (React Native) HOT 2
- Please bump version of remote socketcluster-client
- Remove gulp, and babel dependencies
- Can this client be used in non browser environment ?
- [docs] Add description about `autoReconnectOptions` option
- Unable to resolve as a es module
- Need help for implemeting a real-time chat HOT 1
- Incorrect disconnect code HOT 1
- socketcluster-client with protocol v1 HOT 1
- How to use "subscribeWildcard" instead of "subscribe" ? HOT 1
- How we add headers in socketclusterclient HOT 5
- I got TypeError: Object is not async iterable error while trying to listen to message event in React Native app
- Docs & readme incorrect on "rejectUnauthorized" HOT 3
- eventObject timeout has a timeout set when it's not expecting a response
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 socketcluster-client.