stack-labs / questions

任何关于Micro的问题都可以在Issue中创建
27 stars 6 forks source link

无法通过micro --registry=etcd api --handler=web/api访问handlerFunc #52

Open sidazhang123 opened 4 years ago

sidazhang123 commented 4 years ago

向网关发送http请求会得到如下错误,并发现没有调到相应的HandlerFunc: http: proxy error: dial tcp 10.198.75.60:9999: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. 其中,9999是我web指定端口,10.198.75.60这个不知道是micro api自建子网还是解析错误(ipconfig没有类似的interface),但micro call和直接http访问localhost:9999没问题。

启动网关时尝试指定各种--x_address=127.0.0.1也无效

环境为Windows,无奇怪环境变量,没开代理/防火墙。然而在ubuntu server上,版本完全相同的etcd/golang/go-micro/其它dep就没有该问题。


反复改变网络环境后发现,更常见的问题是: 127.0.0.1 - - [30/Mar/2020:15:08:09 +0800] "POST /rules/get HTTP/1.1" 500 0 "" "PostmanRuntime/7.24.0" 只开了etcd和micro api,在几ms内就返回500,无调试信息。

printfcoder commented 4 years ago

看上去是你开了代理服务,需要给出示例代码才好分析

printfcoder commented 4 years ago

麻烦给下复现代码与运行版本、环境

printfcoder commented 4 years ago

54