douzhuo6931 2019-02-13 13:55
浏览 189

无法在基于Windows Server(RDP)的GoLang上从其他设备运行API

I have API GoLang based with port 1195, i want to run it from other device. I tried and it works on localhost to run the API with Postman.

But when i try to access the API from other device, it didn't work a.k.a Can't connect.

P.S: My 8080 port is accessible for other device, but my 1195 is not accessible Already allowed firewall for port 1195. Tried to change the port but still can't connect on other device

This is my config.ini:

{
    "app_name"       : "HELLOWORLD_API",
    "listening_port" : "1195",
    "host"           : "127.0.0.1",
    "port"           : "3306",
    "user"           : "root",
    "passwd"         : "",
    "dbname"        : "kube71"
}

I expect after I allowed the port 1195, I can connect to the API from other device.

  • 写回答

1条回答 默认 最新

  • duanqing3026 2019-02-13 13:58
    关注

    Try following config:

    { "app_name" : "HELLOWORLD_API", 
      "listening_port" : "1195", 
      "host" : "0.0.0.0", 
      "port" : "3306",
      ...
    }
    

    Basically, change 127.0.0.1 to 0.0.0.0.

    To get more info on why this is the case, have a look at https://superuser.com/questions/949428/whats-the-difference-between-127-0-0-1-and-0-0-0-0

    Putting simply, 0.0.0.0 meaning it will be available to connect from all networks, not only from local

    评论

报告相同问题?

悬赏问题

  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错