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 we add 'url' property to socket.io request? #118

Open
pennylliang opened this issue Jun 24, 2016 · 2 comments
Open

can we add 'url' property to socket.io request? #118

pennylliang opened this issue Jun 24, 2016 · 2 comments

Comments

@pennylliang
Copy link

Our server support both http and socketio, but their base url is not the same, for example:

For http: target is http://localhost:3000

{
  "config": {
      "target": "http://localhost:3000",
      ...
  },
  "scenarios": [
      {
          "name": "upload xxx",
          "flow": [
              {"post": {
                  "url": "/api/xxx/position",
                  "json": {"coords": {"lat": "{{ lat }}", "long": "{{ long }}"}}
              }},

For socket.io: target is http://localhost:3000/passenger

{
  "config": {
      "target": "http://localhost:3000/passenger",
      ...
  },
  "scenarios": [
    {
      "engine": "socketio",
      "flow": [
        {"emit": { "channel": "xxx", "data": {"A":"zh","B":"4"}}},

I want to have http and socket.io in the same JSON, but I can not do that because in socket.io case, I can not specify the url.
Is that possible to add a 'url' property in socket.io case? like:

  "scenarios": [
    {
      "engine": "socketio",
      "flow": [
        {"url": "/passenger",
         "emit": 
          { "channel": "xxx", "data": {"A":"zh","B":"4"}}},
          ...
        }
@hassy
Copy link
Member

hassy commented Jun 24, 2016

👍 good suggestion. My preference would be for the base URL to be set with config.socketio.baseUrl to keep it tidier.

@sloppylopez
Copy link

sloppylopez commented Mar 20, 2017

I have the same problem and it's a bit annoying because I am not sure if I can make a load test that reproduces a server that gets wss and http requests indistinctly, any workaround you may suggest may be great help meanwhile.
Update: After re-reading the whole docu I guess this can be overcame with hooks, will try that today

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

3 participants