-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
createServer implementation #2
Conversation
I would definetly modify aedes.handle function in order to accept a I was also thinking about another idea, I would like to move the mqtt parser to the server factory, so the client will always receive plain mqtt, in that case I would create another function for example Thoughts?
Now I check your permissions |
@getlarge Check now you should be able to push in the repo :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove package-lock.json
Could you explain further your suggestion for |
Yes, that will allow us to remove the client |
Wow the stream implementation looks very good on that PR! Haven't you tested its performance ? Do you know the reason(s) why it would be a "perf killer" ? |
Based on @mcollina comment seems not :( I dunno why, I made some tests and performances seems almost the same, maybe a little bit better but not worse. Anyway we could speak about that next. In the meanwhile we can go on with this. Are you ready to merge here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to remove package-lock.json
It's still not ready for merge i have issues with websocket connection and the protocolDecoder (_socket is undefined), i'm currently extending the example and writing some tests. I'm ok with the
|
Yes i already noticed, the issue was due to |
The latest commit use branches from github instead of packages (for |
index.js
Outdated
} | ||
|
||
const extractConnectionDetails = (options, aedesHandler, conn, req = {}) => { | ||
const onReadable = (err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not have err
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, should i check the stream error event ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes exactly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i simply added this handler for error event:
const onError = (error) => {
conn.removeListener('error', onError)
aedes.emit('error', error)
}
conn.on('error', onError)
Do you anything else to add in it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcollina ping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once we release protocol decoder and aedes so we can chenge them in deps
I think it doesn't matter in which order we publish the repo.
So we'll have to create a new PR for one of the 2 repos in any case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we'll have to create a new PR for one of the 2 repos in any case.
ok so feeel free to merge when you want. Good job @getlarge :)
@getlarge Aedes 0.44.0 is on npm |
@robertsLando Just ping when protocol-decoder is published and i will update package.json on this one. |
@getlarge Ping :) |
@robertsLando ready to merge! |
@getlarge you should have the permission for this so I let you do it :) please use squash and merge and try to use angular commit style: https://github.com/angular/angular/blob/master/CONTRIBUTING.md Also @mcollina please add @getlarge to npm org too so he can help me with releases. P.S: for releases the script is really handy, just run "npm run release" and follow the ci instructions |
I still don't have write access to the repositories, instead of |
The tag is automatically created by release-it when creating a new release, it also publish the package to npm. About the write access I will check it tomorrow
…---
Daniel
On 28 Oct 2020, at 20:51, getlarge ***@***.***> wrote:
I still don't have write access to the repositories, instead of merge button, i have this : "Only those with write access to this repository can merge pull requests."
No problem for the release, i also use release-it, additionally to the package, should i create a tag and a release too ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@getlarge Now you should have write access to this repo too, I dunno why but the permissions of the team was |
@getlarge I have just release a new version on npm, hope matteo will add you there when he can :) |
Just to make a demonstration, i opened the PR.
The implementation can be manually tested for TCP connection, with
node ./example.js
.It seems to work fine, the proxy header is parsed then removed from the stream.
Now the issue that remains is how to pass the protocol (aka connDetails in Aedes) to the client, i made a wrong assumption here. So maybe we could extend the arguments passed to
aedes.handle
to include the connection details and pass them to the client by sending them viapreConnect
event or by directly assigning to the client object ?Anyway i don't see how to do it properly without modifying
aedes.handle
function.@robertsLando Any suggestions ?
Btw i was not able to push to the moscajs repo directly, is it normal ?