-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Comments
Hi @guawazi-glitch , are you meaning raw TCP/UDP sockets? |
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. |
@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 ;) |
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... |
@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! |
I read above discussion and looks like K6 does not support raw socket by Jul2020. can anybody tell me does it support now? |
@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. |
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. |
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)
The text was updated successfully, but these errors were encountered: