This repository was archived by the owner on Sep 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Runtime Configurations
leopoldfreeman edited this page Apr 1, 2015
·
30 revisions
Here are the all runtime configurations of Pomelo.
This config can only be applied to master server.
- Desc: The function to auth user.
- Type: Function.
- Default value: utils.defaultAuthUser from 'pomelo-admin'.
- Desc: The function to auth server.
- Type: Function.
- Default value: utils.defaultAuthServerMaster from 'pomelo-admin'.
app.configure('production|development', 'master', function(){
app.set('masterConfig', {
authUser: function () { ... },
authServer: function () { ... }
});
});The config affects the client of 'pomeo-rpc'. It can be applied to all servers.
- Desc: This flag determines whether the pomelo-rpc sends the message directly or not. If true, it will send the message every 'interval (see below)' milliseconds. If false, it will send the directly.
- Type: Boolean.
- Default value: Not set, which will be evaluated as false.
- Desc: See above. The unit is millisecond. Used when bufferMsg is true.
- Type: Number.
- Default value: 30.
app.configure('production|development', function(){
app.set('proxyConfig', {
bufferMsg: true,
interval: 20
});
});The config affects the server of 'pomeo-rpc'. It can be applied to all servers.
- Same as proxyConfig.bufferMsg.
- Same as proxyConfig.interval.
app.configure('production|development', function(){
app.set('remoteConfig', {
bufferMsg: true,
interval: 20
});
});This configration is not implemented.
This config is for frontend servers.
- Desc: Function to encode data which will be sent over network.
- Type: Function.
- Default value: Provided by connector.
- Desc: Function to decode data received from network.
- Type: Function.
- Default value: Provided by connector.
- Desc: If true, pomelo will use RSA to verify the integrity of the message sent by clients.
- Type: Boolean.
- Default value: Not set, which will be evaluated as false.
- Desc: Function to filter ipv4 address.
- Type: Function.
- Default value: Not set (Do not use this feature, use iptables to filter ips).
Here is one implementation:
function blacklistFun (cb) {
var badIpList = ['192.168.1.1', '192.168.1.2'];
cb(null, badIpList);
}- Desc: If true, pomelo will use RSA to verify the integrity of the message sent by clients.
- Type: Boolean.
- Default value: Not set, which will be evaluated as false.
app.configure('production|development', function(){
app.set('remoteConfig', {
bufferMsg: true,
interval: 20
});
});