tj / axon

message-oriented socket library for node.js heavily inspired by zeromq
MIT License
1.5k stars 155 forks source link

add various methods to Socket class, allowing plugins to customize its behaviour #138

Closed kessler closed 8 years ago

kessler commented 9 years ago
tj commented 9 years ago

hmm I'm not a huge fan of replacing methods as a way to facilitate extension personally

kessler commented 9 years ago

Hi TJ, Thanks for replying. I just thought it would be an efficient way to replace net.createServer with something like tls.createServer without duplicating much code. Client sockets can probably be dealt with but it makes it easier too. We are working on a secure-axon extension...

Is it because you think inheritance breaks encapsulation? or is there another reason?

/cc @arielbadichi

jcrugzz commented 9 years ago

@tj what do you think about adding { secure: TLSOptionsObj }, as configuration passed when creating a socket? It seems like this could be a useful feature for people doing this outside of an internal network. I'll flesh out a PR

kessler commented 9 years ago

@jcrugzz we already got something in the works as a plugin, but it could be easily integrated into the code, maybe you want to use that ?

jcrugzz commented 9 years ago

@kessler I'd like to see what it looks like. I just agree with @tj that overwriting functions on the prototype is meh.

kessler commented 9 years ago

@jcrugzz I will merge the code from the plugin to a fork during the weekend and ping you, ok?

jcrugzz commented 9 years ago

sounds good

navaru commented 9 years ago

@kessler can you please close the issue if it's no longer required?

kessler commented 9 years ago

@TEugen Hey, sorry for letting this slip, let me do a quick check regarding the status of the work I did back then and update this thread

kessler commented 8 years ago

Code is in WIP state, closing this for now