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

jsonp support for monitoring routes? #100

Closed
devfacet opened this issue Aug 13, 2015 · 11 comments
Closed

jsonp support for monitoring routes? #100

devfacet opened this issue Aug 13, 2015 · 11 comments

Comments

@devfacet
Copy link
Contributor

@derekcollison : Would you mind if I add JSONP support to monitoring routes and make a PR? That would help me to improve the tool that I'm working on... I didn't want to waste time if you are not okay with it.

Update: Note that I want to put more stuff to client side but can't do it due to CORS. That's the reason for JSONP.

@derekcollison
Copy link
Member

Just to /routez?

On Wed, Aug 12, 2015 at 5:15 PM -0700, "Fatih Cetinkaya" notifications@github.com wrote:

@derekcollison : Would you mind if I add jsonp support to monitoring routes and make a PR? That would help me to improve the tool that I'm working on... I didn't want to waste time if you are not okay with it.


Reply to this email directly or view it on GitHub.

@devfacet
Copy link
Contributor Author

All routes; /varz, /connz, /routez and /subscriptionsz

@derekcollison
Copy link
Member

Send a PR, sounds fine to me.. What application is this for?

On Wed, Aug 12, 2015 at 6:51 PM, Fatih Cetinkaya notifications@github.com
wrote:

All routes; /varz, /connz, /routez and /subscriptionsz


Reply to this email directly or view it on GitHub
#100 (comment).

@devfacet
Copy link
Contributor Author

Cool, will send a PR in a few days. It is for the tool that I'm working on. https://github.com/cmfatih/natsboard

@repejota
Copy link
Contributor

+1

That would help a lot also on another monitor I'm working on.

@derekcollison
Copy link
Member

Nice!

On Wed, Aug 12, 2015 at 9:39 PM, Fatih Cetinkaya notifications@github.com
wrote:

Cool, will send a PR in a few days. It is for the tool that I'm working
on. https://github.com/cmfatih/natsboard


Reply to this email directly or view it on GitHub
#100 (comment).

@pkieltyka
Copy link

Have a look at https://github.com/pressly/gohttpware/tree/master/jsonp for a Jsonp middleware that stays out of the way and is triggered by the content type. It's my code, feel free to copy / augment if it helps

@devfacet
Copy link
Contributor Author

@pkieltyka : It would be awesome if you take over this task and deliver since you have already experience with it. What you say? :)

@pkieltyka
Copy link

Sure, no prob. I'll submit PR tomm

On Aug 13, 2015, at 8:47 PM, Fatih Cetinkaya notifications@github.com wrote:

@pkieltyka : It would be awesome if you take over this task and deliver since you have already experience with it. What you say? :)


Reply to this email directly or view it on GitHub.

@devfacet
Copy link
Contributor Author

Sound awesome to me 👍

@devfacet
Copy link
Contributor Author

@pkieltyka : I just made a PR for it. It was more easier than I thought. Somehow I always hesitate about my golang skills :)

Can you check it and let me know whether I'm naif or not? https://github.com/nats-io/gnatsd/pull/103/files

I locally test it and it works for;

$.getJSON('http://localhost:8222/connz?callback=?', function(data) { console.log(data); });

or

$.ajax({
  url: 'http://localhost:8222/connz',
  dataType: 'jsonp',
  jsonpCallback: 'callback',
  success: function(data) {
    console.log(data);
  }
});

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

No branches or pull requests

4 participants