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

Can k6 support socket protocol ? not websocket. #1493

Closed
ghost opened this issue Jun 9, 2020 · 8 comments
Closed

Can k6 support socket protocol ? not websocket. #1493

ghost opened this issue Jun 9, 2020 · 8 comments
Labels
evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature

Comments

@ghost
Copy link

ghost commented Jun 9, 2020

Feature Description

Does k6 support socket protocol? If not, how could I extend this function based on k6? Is there any examples?

Suggested Solution (optional)

@ghost ghost added the feature label Jun 9, 2020
@mstoykov
Copy link
Contributor

mstoykov commented Jun 9, 2020

Hi @guawazi-glitch , are you meaning raw TCP/UDP sockets?
If so, I don't think this has been proposed, but I would say this will need to wait for event-loop actually being done. I don't think it is also something that the vast majority of users will be interested in ... but maybe I am wrong

@mstoykov mstoykov added the evaluation needed proposal needs to be validated or tested before fully implementing it in k6 label Jun 9, 2020
@leovanalphen
Copy link

I'm personally rather interested in this as well. We have a mixed HTTPS / raw sockets API (IOT kind of thing). We currently use jMeter to loadtest many connected IoT devices, some devices use HTTPS but others use SSL over raw TCP, in jMeter we use Groovy for the raw socket connections but it doesn't feel like a nice fit.

I came across K6 and it looks way nicer to use than jMeter, but I can't switch without raw socket support.

@mstoykov
Copy link
Contributor

@leovanalphen, I can't give you any estimates on when we are going to work on this ... as there is quite a lot of other stuff that are way higher the priority list, and so far there have been two different people who have asked for this, without really any discussion on what the support needs to support :D.

You are free to try and add it to k6 and possibly we can talk about the API and what will need to be supported in order to be merged. I would prefer it if the API is based on some standard ... but I don't know of anything else but nodejs(and possibly deno) that can come even close to a standard for this ... :(. But I haven't looked into it so 🤷‍♂️

You can look at #1353 and the #1396 and try and build a small plugin for your use case. I guess you can base yours on this one which also has metric emission. The plugin support is fairly high on the priority list, so hopefully, we will start working on it after 0.27.0(this week) and 0.27.1(possibly next week) get released ;)

@na--
Copy link
Member

na-- commented Jul 13, 2020

The biggest obstacle to raw socket support is the lack of a global event loop in k6: #882

Without it, we'd be a lot more limited in supporting any asynchronous protocol like this, and will basically repeat the mistakes k6 has with supporting websockets 😞 So, until we have that, any socket support will probably be as a plugin, at most...

@leovanalphen
Copy link

@mstoykov I'll go and have a look if I can get something working inside a plugin, thanks for the links. I just came across K6 today so I'm still having a bit of a look around. I understand this isn't a feature that is exactly on the top of the pile, I'll see if I can allocate some time this week and try to cook something up.

Cheers!

@gauraval
Copy link

gauraval commented Sep 29, 2021

I read above discussion and looks like K6 does not support raw socket by Jul2020. can anybody tell me does it support now?

@imiric
Copy link
Contributor

imiric commented Sep 29, 2021

@gauraval Since then we've released xk6 and there's now an extension that adds support for writing to a TCP socket: https://github.com/NAlexandrov/xk6-tcp.

If this is what was meant by the original feature request, and not something like socket.io or Linux raw sockets, which I'm not entirely clear about.

@olegbespalov
Copy link
Contributor

After discussing internally, the k6 maintainers team decided to close this issue. The possible implementation of TCP/UDP support could be tracked in a separate issue if needed.

@olegbespalov olegbespalov closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature
Projects
None yet
Development

No branches or pull requests

6 participants