change grpc port to 9000 (#291)
* change grpc port to 9000 Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * change grpc port to 9000 Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
50237f4fd1
commit
6d29e638b4
|
@ -10,6 +10,6 @@ LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>"
|
||||||
ADD config/config.yml /
|
ADD config/config.yml /
|
||||||
ADD bin/gorush /
|
ADD bin/gorush /
|
||||||
|
|
||||||
EXPOSE 8088
|
EXPOSE 8088 9000
|
||||||
ENTRYPOINT ["/gorush"]
|
ENTRYPOINT ["/gorush"]
|
||||||
CMD ["-c", "config.yml"]
|
CMD ["-c", "config.yml"]
|
||||||
|
|
|
@ -10,6 +10,6 @@ LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>"
|
||||||
ADD config/config.yml /
|
ADD config/config.yml /
|
||||||
ADD bin/gorush-arm /gorush
|
ADD bin/gorush-arm /gorush
|
||||||
|
|
||||||
EXPOSE 8088
|
EXPOSE 8088 9000
|
||||||
ENTRYPOINT ["/gorush"]
|
ENTRYPOINT ["/gorush"]
|
||||||
CMD ["-c", "config.yml"]
|
CMD ["-c", "config.yml"]
|
||||||
|
|
|
@ -10,6 +10,6 @@ LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>"
|
||||||
ADD config/config.yml /
|
ADD config/config.yml /
|
||||||
ADD bin/gorush-arm64 /gorush
|
ADD bin/gorush-arm64 /gorush
|
||||||
|
|
||||||
EXPOSE 8088
|
EXPOSE 8088 9000
|
||||||
ENTRYPOINT ["/gorush"]
|
ENTRYPOINT ["/gorush"]
|
||||||
CMD ["-c", "config.yml"]
|
CMD ["-c", "config.yml"]
|
||||||
|
|
|
@ -92,7 +92,7 @@ core:
|
||||||
|
|
||||||
grpc:
|
grpc:
|
||||||
enabled: false # enabale gRPC server
|
enabled: false # enabale gRPC server
|
||||||
port: 50051
|
port: 9000
|
||||||
|
|
||||||
api:
|
api:
|
||||||
push_uri: "/api/push"
|
push_uri: "/api/push"
|
||||||
|
@ -675,7 +675,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
address = "localhost:50051"
|
address = "localhost:9000"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -710,7 +710,7 @@ var services = require('./gorush_grpc_pb');
|
||||||
var grpc = require('grpc');
|
var grpc = require('grpc');
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
var client = new services.GorushClient('localhost:50051',
|
var client = new services.GorushClient('localhost:9000',
|
||||||
grpc.credentials.createInsecure());
|
grpc.credentials.createInsecure());
|
||||||
var request = new messages.NotificationRequest();
|
var request = new messages.NotificationRequest();
|
||||||
request.setPlatform(2);
|
request.setPlatform(2);
|
||||||
|
|
|
@ -188,7 +188,7 @@ func BuildDefaultPushConf() ConfYaml {
|
||||||
|
|
||||||
// gRPC Server
|
// gRPC Server
|
||||||
conf.GRPC.Enabled = false
|
conf.GRPC.Enabled = false
|
||||||
conf.GRPC.Port = "50051"
|
conf.GRPC.Port = "9000"
|
||||||
return conf
|
return conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ core:
|
||||||
|
|
||||||
grpc:
|
grpc:
|
||||||
enabled: false # enabale gRPC server
|
enabled: false # enabale gRPC server
|
||||||
port: 50051
|
port: 9000
|
||||||
|
|
||||||
api:
|
api:
|
||||||
push_uri: "/api/push"
|
push_uri: "/api/push"
|
||||||
|
|
|
@ -119,7 +119,7 @@ func (suite *ConfigTestSuite) TestValidateConfDefault() {
|
||||||
|
|
||||||
// gRPC
|
// gRPC
|
||||||
assert.Equal(suite.T(), false, suite.ConfGorushDefault.GRPC.Enabled)
|
assert.Equal(suite.T(), false, suite.ConfGorushDefault.GRPC.Enabled)
|
||||||
assert.Equal(suite.T(), "50051", suite.ConfGorushDefault.GRPC.Port)
|
assert.Equal(suite.T(), "9000", suite.ConfGorushDefault.GRPC.Port)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ConfigTestSuite) TestValidateConf() {
|
func (suite *ConfigTestSuite) TestValidateConf() {
|
||||||
|
@ -184,7 +184,7 @@ func (suite *ConfigTestSuite) TestValidateConf() {
|
||||||
|
|
||||||
// gRPC
|
// gRPC
|
||||||
assert.Equal(suite.T(), false, suite.ConfGorush.GRPC.Enabled)
|
assert.Equal(suite.T(), false, suite.ConfGorush.GRPC.Enabled)
|
||||||
assert.Equal(suite.T(), "50051", suite.ConfGorush.GRPC.Port)
|
assert.Equal(suite.T(), "9000", suite.ConfGorush.GRPC.Port)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConfigTestSuite(t *testing.T) {
|
func TestConfigTestSuite(t *testing.T) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
address = "localhost:50051"
|
address = "localhost:9000"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ var services = require('./gorush_grpc_pb');
|
||||||
var grpc = require('grpc');
|
var grpc = require('grpc');
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
var client = new services.GorushClient('localhost:50051',
|
var client = new services.GorushClient('localhost:9000',
|
||||||
grpc.credentials.createInsecure());
|
grpc.credentials.createInsecure());
|
||||||
var request = new messages.NotificationRequest();
|
var request = new messages.NotificationRequest();
|
||||||
request.setPlatform(2);
|
request.setPlatform(2);
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
port = ":50051"
|
port = ":9000"
|
||||||
)
|
)
|
||||||
|
|
||||||
// server is used to implement gorush grpc server.
|
// server is used to implement gorush grpc server.
|
||||||
|
@ -46,7 +46,7 @@ func RunGRPCServer() error {
|
||||||
|
|
||||||
lis, err := net.Listen("tcp", ":"+gorush.PushConf.GRPC.Port)
|
lis, err := net.Listen("tcp", ":"+gorush.PushConf.GRPC.Port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
gorush.LogError.Error("failed to listen: %v", err)
|
gorush.LogError.Errorf("failed to listen: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
s := grpc.NewServer()
|
s := grpc.NewServer()
|
||||||
|
@ -55,7 +55,7 @@ func RunGRPCServer() error {
|
||||||
reflection.Register(s)
|
reflection.Register(s)
|
||||||
gorush.LogAccess.Debug("gRPC server is running on " + gorush.PushConf.GRPC.Port + " port.")
|
gorush.LogAccess.Debug("gRPC server is running on " + gorush.PushConf.GRPC.Port + " port.")
|
||||||
if err := s.Serve(lis); err != nil {
|
if err := s.Serve(lis); err != nil {
|
||||||
gorush.LogError.Error("failed to serve: %v", err)
|
gorush.LogError.Errorf("failed to serve: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue