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

Update to latest socket.io #119

Open
IngwiePhoenix opened this issue Mar 21, 2015 · 13 comments
Open

Update to latest socket.io #119

IngwiePhoenix opened this issue Mar 21, 2015 · 13 comments

Comments

@IngwiePhoenix
Copy link

I just found this project via npmjs and I totally love the concept of it and want to use it in my app. However, I have an issue...and that is, the outdated socket.io dependency. You require 0.9.x, but 1.3.x is the current. Is it possible to update master?

@xinyuwang
Copy link

I can't agree more. Looking forward the next change.

@IngwiePhoenix
Copy link
Author

I had to revert my app back to separated socket.io and express since I need to use 1.3.x. But I’m totally looking forward to an updated version that will have the newer versions in!

BTW I tested what happens if I just kinda update all dependencies and try to run a demo:

[email protected] ~/W/e/e/http-io $ node app

/Users/Ingwie/Work/express.io/compiled/index.js:106
    this.io.configure((function(_this) {
            ^
TypeError: Object #<Server> has no method 'configure'
    at EventEmitter.express.application.io (/Users/Ingwie/Work/express.io/compiled/index.js:106:13)
    at Object.<anonymous> (/Users/Ingwie/Work/express.io/examples/http-io/app.js:2:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

@geekytime
Copy link

There was quite a bit of cleanup between 0.9.x and 1.3.x of socket.io. There's a migration guide, if anyone has time to submit a Pull Request to fix the breaks. It doesn't look too painful, but I just don't have time to try it out right now.

@IngwiePhoenix
Copy link
Author

That actually seems do-able… If it is a 0.9 to 1.3 guide in particular, then I could do that because I do have a lot of time at hand - and I would really like to use this project! :) So I’ll see if I can make that happen...

Am 30.03.2015 um 17:45 schrieb Chris Jaynes [email protected]:

There was quite a bit of cleanup between 0.9.x and 1.3.x of socket.io. There's a migration guide http://socket.io/docs/migrating-from-0-9/, if anyone has time to submit a Pull Request to fix the breaks. It doesn't look too painful, but I just don't have time to try it out right now.


Reply to this email directly or view it on GitHub #119 (comment).

@geekytime
Copy link

Since I posted that link, I have spent some time exploring the various options out there for WebSockets. Primus, which calls itself "an abstraction layer for real-time", explains pretty well why they stuck with socket.io 0.9.x.

Note: Primus will never support Socket.IO 1.0. As it's just an abstraction build upon Engine.IO so it makes more sense to use Engine.IO in Primus directly. Socket.IO 0.9.x will be supported as it uses a completely different transport system.

I realize that express.io is coming from a very different angle than Primus, but it does make me wonder if the decision to stick with socket.io 0.9.x might have been based on similar arguments...

@IngwiePhoenix
Copy link
Author

I have some time now...and due to a refactor of my project I will sit down and work this out now - because this project will very simply reduce the compecity of my code.

With refactor, I mean moving my code from being a single-process monster to becoming a multi-process thing. The structure is that there are multiple workers of multiple kinds. for isntance, my local maschine would spawn 8 front-end workers (serving files), 2 workers especially for the chat - that runs via socket.io - and more. But all of them go out on the same http port and such...so it will just be a ton easier if using this project.

So yeah, to the fork button I go!

@IngwiePhoenix
Copy link
Author

...and then I learn this thing is coffeescripted. I am doomed :P I can see what needs to be changed thanks to the link for the migration guide BUT coding in a "new" language is gonna be a thing...

@IngwiePhoenix
Copy link
Author

    @_router.stack.push layer

Layer._router does not exist...and now I dont know where to put this. Everything else so far works. But appearently, not being able to register the Layer is an issue...?

@IngwiePhoenix
Copy link
Author

Okay okay, I got that down. However, I am now stuck at a pretty problem that I know how to solve in JS, at least I think so, but not in Coffee...

So, I re-wrote this layer function into a typical callback and now I want to overwrite express.application.defaultConfiguration to call this.use(...) with the correct context. But... how exactly do I get this right?

defaultConfiguration = express.application.defaultConfiguration
express.application.defaultConfiguration = ->
    defaultConfiguration.apply this
    @use eioInitialize

eioInitialize is the router that initializes request.io. I want to add this middleware upon initialization. Any idea how to solve this?

@IngwiePhoenix
Copy link
Author

If someone can give me a hint to fix this, let me know please! :)

@sibartlett
Copy link

Sorry, I don't usually do shameless self-promotion - but I forked express.io a few months ago here. It supports the latest versions of both socket.io and express. I also rewrote it in plain JavaScript, and changed the API (documented in the readme).

@IngwiePhoenix
Copy link
Author

I dont see why this would be shameless? :) It’s very nice to see you re-writing it in pure JS - it really helps a lot! CoffeeScript is just not my language…and I am very sure I am done trying to deal with it :)
Will check out the fork and see how well it turns out - thanks for letting us know about it!

On Fr. Apr. 17 2015 02:18:51 Simon Bartlett wrote:

Sorry, I don't usually do shameless self-promotion - but I forked express.io a few months ago here https://github.com/sibartlett/express.oi. It supports the latest versions of both socket.io and express. I also rewrote it in plain JavaScript, and changed the API (documented in the readme).


Reply to this email directly or view it on GitHub #119 (comment).

@zbyte64
Copy link

zbyte64 commented Apr 22, 2015

+1

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

5 participants