-
Notifications
You must be signed in to change notification settings - Fork 2.9k
wsPort & port #23
Comments
Yeah, the And the html pages contents located in web server. You have to start the web server to access the web pages. And the start point of the web server is More details of your access fail error or configure file may be helpful to locate the problem. :) |
I removed the wsport configuration of chat server in the config/servers.json, and everything works fine. "chat": [
{"id": "chat-server-1", "host": "127.0.0.1", "port": 6150, "wsPort":6010},
{"id": "chat-server-2", "host": "127.0.0.1", "port": 6151, "wsPort":6011},
{"id": "chat-server-3", "host": "127.0.0.1", "port": 6152, "wsPort":6012}
] To: "chat": [
{"id": "chat-server-1", "host": "127.0.0.1", "port": 6150},
{"id": "chat-server-2", "host": "127.0.0.1", "port": 6151},
{"id": "chat-server-3", "host": "127.0.0.1", "port": 6152}
] If I error configure with a wsPort, the request to chat server pomelo.request('chat.chatHandler.getUsers',..) will results an error at file '/game-server/node_modules/pomelo/lib/server/server.js' Line 182, var doForward = function(app, msg, session, routeRecord, cb) {
var finished = false;
//should route to other servers
try {
app.sysrpc[routeRecord.serverType].msgRemote.forwardMessage( where the msgRemote will be 'undefined' and the serverType is 'chat'. |
If you configure a server with a The frontend server has the ability of receiving the client requests from websocket and the backend server has the ability to receive requests from frontend server. So when you add a |
If so, then the configuration of connector servers don't need the port configuration at all. "connector":[
{"id":"connector-server-1", "host":"127.0.0.1", "port":4050, "wsPort":3050},
{"id":"connector-server-2", "host":"127.0.0.1", "port":4051, "wsPort":3051},
{"id":"connector-server-3", "host":"127.0.0.1", "port":4052, "wsPort":3052}
] |
Connector server is frontend server. It needs the ability of receiving client requests. |
The port is the ability to receiving rpc requests and the connector has to provide rpc services such as channel push and so on. So the port is necessary for connector. |
wsPort is used to receive client requests, not port. |
The |
I finally totally understand.
|
Yeah, some details in picture:
assume request transfer from client to frontend server and then to backend server. And |
I error configure the chat server with a wsport, and the request to chat server can't be accessed.
I thought the wsPort is used for outside access like clients and html pages, the port is used for communication between servers. But I don't know am I right? And the real reason of my error configuration.
The text was updated successfully, but these errors were encountered: