简体   繁体   English

使用Docker容器从Java连接到Meteor DDP

[英]Connecting to Meteor DDP from Java with Docker container

I am here just to share some experience with java DDP Client Meteor and Docker 我在这里只是分享一些Java DDP Client Meteor和Docker的经验

Hello I am accessing to a meteor docker container from a J2EE docker container and it fails because there are some trouble at the connection with the server name (corresponding to "meteor" in my compose file) and the port "82". 您好,我正在从J2EE docker容器访问meteor docker容器,它失败了,因为服务器名称(对应于我的撰写文件中的“ meteor”)和端口“ 82”的连接存在一些问题。

In this case it doesn't take into account the port and it replaces it with a default value 80... so the connection fails... 在这种情况下,它不考虑端口,而是将其替换为默认值80 ...因此连接失败...

WHY ? 为什么呢? because URI don't handle domain name without dots eg : 因为URI不能处理没有点的域名,例如:

  • connect to meteor_1 port 3000 连接到meteor_1端口3000
  • the uri is ws://meteor_1:3000/websocket uri是ws:// meteor_1:3000 / websocket
  • but int port = uri.getPort(); 但是int port = uri.getPort(); -> -1 and the ddp client fallback to 80 by default -> -1,默认情况下ddp客户端回退到80

I'll give a try this evening with a image name with a dot as it passes in java but I yet didn't test with the docker compose 今天晚上我会尝试用带点的图像名称进行传递,因为它在Java中通过了,但是我还没有使用docker compose进行测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM