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

Configuring haproxy from JSON #11

Open
cadorn opened this issue May 16, 2015 · 3 comments
Open

Configuring haproxy from JSON #11

cadorn opened this issue May 16, 2015 · 3 comments

Comments

@cadorn
Copy link

cadorn commented May 16, 2015

Have you thought about or are you aware of any efforts to configure haproxy or a subset of its features using JSON?

@3rd-Eden
Copy link
Member

I have no idea, but it wouldn't be that hard to implemented for this module as our internal configuration parser just saves it to a object so we could just read/save JSON structures if needed. cc @Swaagie

@cadorn
Copy link
Author

cadorn commented May 17, 2015

our internal configuration parser

Does it handle full haproxy config syntax parsing and generation to and from JSON already?

@Swaagie
Copy link
Member

Swaagie commented May 17, 2015

Been a while since I worked on this, it already reads from JSON it seems, but that is pretty easy of course https://github.com/observing/haproxy/blob/master/lib/parser.js#L20-L29. That said it keeps track of all values through an object like @3rd-Eden said, so a stringify of the internal representation should be enough. However it will result in a loss of comments as those are not supported by JSON, https://github.com/observing/haproxy/blob/master/lib/parser.js#L64-L66

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

3 participants