Comments (3)
GatewayClient 和 GatewayWorker是在一个内网里使用,start_gateway.php里$gateway->lanIp设置成内网ip,register服务监听内网ip即可。
例如GatewayClient 和 GatewayWorker在同一台服务器的话$gateway->lanIp设置127.0.0.1,start_register.php里0.0.0.0改成127.0.0.0.1。
这样外部网络就无法通过GatewayClient连接你的Gateway服务了。
from gatewayclient.
GatewayClient 和 GatewayWorker是在一个内网里使用,start_gateway.php里$gateway->lanIp设置成内网ip,register服务监听内网ip即可。
例如GatewayClient 和 GatewayWorker在同一台服务器的话$gateway->lanIp设置127.0.0.1,start_register.php里0.0.0.0改成127.0.0.0.1。
这样外部网络就无法通过GatewayClient连接你的Gateway服务了。
这个我知道,但问题是内网也是有不同的业务划分的,也不是在同一个内网就有权。
甚至更复杂的是,同一个gateway跑多个业务,不同的client只能给各自的业务发消息。
from gatewayclient.
Gateway和GatewayClient支持设置secretKey,secretKey类似密码的作用,用法是
start_gateway.php start_businessworker.php start_register.php 里分别加上
$gateway->secretKey='yourpassword';
$worker->secretKey='yourpassword';
$register->secretKey='yourpassword';
GatewayClient调用前设置secretKey类似如下
Gateway::$secretKey='yourpassword';
保证所有地方secretKey都设置一致,这样外部没有正确的secretKey时就无法调用了。
from gatewayclient.
Related Issues (20)
- 升级测试3.0.0升级到3.0.9不能绑定uid,返回null HOT 6
- constant spell wrong HOT 1
- PHP Warning: pack(): Type H: illegal hex digit HOT 3
- Fatal error: in ../../Gateway.php on line 1286 HOT 3
- Can not connect to tcp://127.0.0.1:1236 Connection refused HOT 2
- GatewayWorker 使用的是3.0.12版本 PHP 5.6.31 安装时报如下错误: composer require workerman/gatewayclient HOT 1
- How can I send messages to different server in one request ? HOT 1
- memory leak problem
- 使用client循环到注册中心去取数据有时候会报错 HOT 2
- GatewayClient使用Gateway::getUidListByGroup报错 HOT 1
- 使用GatewayClient的时候报错,本来好好的,不知道为啥突然报错了。、 HOT 1
- 在一次http接口请求中执行多次sendToUid报错 HOT 1
- 容器端口映射后,通过宿主机ip访问会出错,不兼容!
- 大佬 把 gateway.php的 19行 版本改一下吧 HOT 1
- strlen() expects parameter 1 to be string, array given HOT 1
- Windows+WSL开发环境
- 前端异常掉线,GatewayClient如何感知 HOT 1
- 建议把 self::$registerAddress 改成 static::$registerAddress HOT 2
- 关于Gateway类中的secretKey 说明 HOT 2
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 gatewayclient.