Add in proto to INFO

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2018-06-29 10:43:08 -07:00
parent 535367e340
commit a7dd092136
2 changed files with 9 additions and 1 deletions

View File

@@ -35,7 +35,13 @@ var (
const (
// VERSION is the current version for the server.
VERSION = "1.2.0-beta3"
VERSION = "1.2.0-beta4"
// PROTO is the currently supported protocol.
// 0 was the original
// 1 maintains proto 0, adds echo abilities for CONNECT from the client. Clients
// should not send echo unless proto in INFO is >= 1.
PROTO = 1
// DEFAULT_PORT is the default port for client connections.
DEFAULT_PORT = 4222

View File

@@ -41,6 +41,7 @@ import (
type Info struct {
ID string `json:"server_id"`
Version string `json:"version"`
Proto int `json:"proto"`
GitCommit string `json:"git_commit,omitempty"`
GoVersion string `json:"go"`
Host string `json:"host"`
@@ -144,6 +145,7 @@ func New(opts *Options) *Server {
info := Info{
ID: genID(),
Version: VERSION,
Proto: PROTO,
GitCommit: gitCommit,
GoVersion: runtime.Version(),
Host: opts.Host,