Comments (3)
Try explicitly setting 0.0.0.0
:
ip: 0.0.0.0
port: 9092
from trpc-go.
it seems in config.go will set the ip to global local ip when the ip in configure is empty.
// RepairConfig repairs the Config by filling in some fields with default values.
func RepairConfig(cfg *Config) error {
// nic -> ip
if err := repairServiceIPWithNic(cfg); err != nil {
return err
}
// set default read buffer size
if cfg.Global.ReadBufferSize == nil {
readerSize := codec.DefaultReaderSize
cfg.Global.ReadBufferSize = &readerSize
}
codec.SetReaderSize(*cfg.Global.ReadBufferSize)
// protocol network ip empty
for _, serviceCfg := range cfg.Server.Service {
setDefault(&serviceCfg.Protocol, cfg.Server.Protocol)
setDefault(&serviceCfg.Network, cfg.Server.Network)
setDefault(&serviceCfg.IP, cfg.Global.LocalIP)
setDefault(&serviceCfg.Transport, cfg.Server.Transport)
setDefault(&serviceCfg.Address, net.JoinHostPort(serviceCfg.IP, strconv.Itoa(int(serviceCfg.Port))))
// server async mode by default
if serviceCfg.ServerAsync == nil {
enableServerAsync := true
serviceCfg.ServerAsync = &enableServerAsync
}
// writev disabled by default
if serviceCfg.Writev == nil {
enableWritev := false
serviceCfg.Writev = &enableWritev
}
if serviceCfg.Timeout == 0 {
serviceCfg.Timeout = cfg.Server.Timeout
}
if serviceCfg.Idletime == 0 {
serviceCfg.Idletime = defaultIdleTimeout
if serviceCfg.Timeout > defaultIdleTimeout {
serviceCfg.Idletime = serviceCfg.Timeout
}
}
}
setDefault(&cfg.Client.Namespace, cfg.Global.Namespace)
for _, backendCfg := range cfg.Client.Service {
repairClientConfig(backendCfg, &cfg.Client)
}
return nil
}
from trpc-go.
so the unspecified "ip" not indicated that listen to all interface, it will choose lastest specified "ip" in service or local ip specified. it seems an uncertain operation, maybe it can mentioned in docs.
Try explicitly setting
0.0.0.0
:ip: 0.0.0.0 port: 9092
from trpc-go.
Related Issues (20)
- trpc-go doesn't support gRPC protocol? HOT 10
- How to customize the log output format in "console" mode? HOT 4
- Why FormDataSerialization.Marshal use JSONPBSerialization.Marshal to implement? HOT 1
- 有没有相关交流群呢 HOT 1
- When I go to run $ cd server && go run main.go times wrong./ trpc_go.yaml does not exist HOT 2
- When I go to run $ cd server && go run main.go times wrong./ trpc_go.yaml does not exist
- git lfs png fail
- Difference between intranet and open source project HOT 3
- Ask some trpc-go project for RESTful API HOT 1
- google.protobuf.Empty unknown
- Could you share some of the more frequently asked framework questions from the internal network (similar to common software issues) HOT 2
- plugin: Simplify global config by generic HOT 6
- proposal: codec: remove json-iterator and use official encoding/json HOT 16
- Are there community communication channels like WeChat or Slack available for the project? HOT 2
- Is there any plan for this project this year?
- question: how to solve the problem that the program show error code :141 and 171 HOT 12
- question: trpc: Is there any way I could know whether an *server.Server is new-ed? HOT 4
- affected/package: mockgen更新有点随意 HOT 6
- go.sum: checksum mismatch, please run go mod tidy to update this file in v1.0.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trpc-go.