Open Geal opened 7 years ago
Hello @Geal I want to contribute the java client version. Any idea how to start?
Hi! I'm the blocker here, since I should first export JSON messages with the new format. Or find a way to generate a JSON schema from configuration messages.
There's a good way to extract some config messages right now: launch a proxy with some static configuration like this: https://github.com/sozu-proxy/sozu/blob/master/bin/config.toml#L40-L49
then save the corresponding config messages with sozuctl -c config.toml state save -f state.json
You won't see the answers to config messages, but that's a good way to start and mess with the proxy.
I guess, to start, you should have a way to connect to a unix socket by its path, and send the JSON messages there. You can work with blocking or non blocking sockets, it should not be an issue.
There is a list of example messages and answers here: https://github.com/sozu-proxy/sozu/tree/master/command/assets It might change a bit before the release, but since those files are part of the unit tests, any change in the format will appear in those files
I just started an Elixir implementation, it's available here: https://github.com/evuez/exsozu (it's more of a draft for now so there isn't much to play with but I'm working on it 🙂)
@evuez great news!
It's seem nodejs use SOCK_DGRAM
to consume data for net.createConnection("pathto/command_folder/socket")
. So we have to make a tiny library C/C++/Rust to make a SOCK_STREAM
connection and call it in nodejs.
It's seem nodejs use
SOCK_DGRAM
to consume data fornet.createConnection("pathto/command_folder/socket")
. So we have to make a tiny library C/C++/Rust to make aSOCK_STREAM
connection and call it in nodejs.
Hi, is there any progress about this ?
@rizkyramadhan Hello, I'm pretty sure there was no progress on this one. Is this something in which you would be interested to jump-in?
The beginnings of a Nodejs client here .
From the manual testing I have done so far it appears to work, able to send and receive the status command to Sozu.
Interpreting the Nodejs documentation it has the following to say about the net module:
The net module provides an asynchronous network API for creating stream-based TCP or IPC servers ... The newly created socket can be either a TCP socket or a streaming IPC endpoint, depending on what it connect() to.
So we will see how this goes!
@davidmaceachern this is great, thanks!
The command library allows easy communication with the proxy through its command unix socket.
The protocol is actually JSON messages separated by a null character, so it should be straightforward to make API clients in different languages. The protocol changed a lot lately, but it is stabilizing, and carries version information.
Those API clients would probably live in other repositories of this github organisation.
Who is up for it?