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

Some fixes for options in constructor #7

Closed
frct1 opened this issue Feb 24, 2018 · 4 comments
Closed

Some fixes for options in constructor #7

frct1 opened this issue Feb 24, 2018 · 4 comments

Comments

@frct1
Copy link

frct1 commented Feb 24, 2018

Hi :)
Today i was need connect to SQ interface from custom ip and i'm seeing lib source. And i have the one fix for this.
Assign ip to connect we can only in connect method, but in library there pass only host and port => we cann pass custom ip to connect.
passing options to `new net.Socket(options) didn't do enough actions.
this is fixes from node js noob, but it pretty works

constructor(host, port, options={}) {
[some code]
Object.assign(options,{port:port,host:host});
sock.connect(options);

Then we can connect to sq with from custom ip by this code
new TeamspeakQuery(server.ip, server.query,{localAddress:'my.ip.123.322'});
I'm sure that you can offer a more intelligent version of this function 😄

@schroffl
Copy link
Owner

You want to be able to pass options to the net.Socket.connect function?

@frct1
Copy link
Author

frct1 commented Feb 24, 2018

Yes, for greater flexibility in connection parameters to SQ.
I think it will useful for future users this lib

@schroffl
Copy link
Owner

schroffl commented Feb 24, 2018

Published in v2.0.0.

@frct1
Copy link
Author

frct1 commented Feb 24, 2018

You are the best. Thanks for the quick response.

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

No branches or pull requests

2 participants