You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just made my first xk6 extension which was very fun! Basically it allows you to talk to NATS from k6 scripts.
Everything is working fine on localhost (as always), however I see an error when running in our staging environment, where every outgoing HTTP request must go through our corporate proxy.
import{check}from'k6';importnatsfrom'k6/x/nats';import*asfakerfrom'faker/locale/en_US';exportletoptions={vus: 10,duration: '30s',};constnatsTimeoutMS=2000;constnatsServer='nats:4222';constnatsClient=newnats.Client(natsServer,natsTimeoutMS);exportdefaultfunction(){constwant='sample data'constpayload=faker.name.findName()constsubject='testSubject';vargot=natsClient.request(subject,payload)check(got,{'Correct data received from NATS': (data)=>data===want})constreportingSubject='reports.loadTest';natsClient.publish(reportingSubject,'Tested OK!');}
The script get bundled with webpack to include
When running the custom binary the proxy settings are set as env vars:
I have no experience with nats, but from this docs it seems it is not HTTP based but just build on top of tcp. This means that setting HTTPS_PROXY will not help you.
I will close this as I don't think this is about the development of xk6 or anything that we can do. You are very much welcome though to open a thread on the community forum where I and others can still help you.
Hi,
I've just made my first xk6 extension which was very fun! Basically it allows you to talk to NATS from k6 scripts.
Everything is working fine on localhost (as always), however I see an error when running in our staging environment, where every outgoing HTTP request must go through our corporate proxy.
Extension code:
Which gets built into a binary:
$ xk6 build v0.31.1 --with github.com/username/xk6-nats-bridge="/home/username/go/src/github.com/username/xk6-nats-bridge"
Used in a script:
The script get bundled with webpack to include
When running the custom binary the proxy settings are set as env vars:
The code works fine when running on my local kubernetes cluster (no proxy), but fails on another cluster that uses the proxy.
It fails with the following error:
I know that xk6 is bleeding edge and experimental, but any pointers on what goes wrong, or how to increase logging will be much appreciated.
The text was updated successfully, but these errors were encountered: