set Port
- framework.route(url, fn, [flags]);
- framework.websocket(url, fn, [options]);
You recommend:
options.ip = '127.0.0.1'; options.port = '1234'; require('total.js').http('release', options);
How to set port for each call?
F.route('/command/', use_command, {flags: ["post"], timeout: 10000}); F.websocket('/', socket_modules, ['json', F.config.site_url]);
Now "route" and "websocket" use port=1234
I want use different port fot each call:
For Examle: F.route('/command/1/', use_command1, .... => port=1111 F.route('/command/2/', use_command2, .... => port=2222 F.websocket('/', socket_modules, ..... =>port=5555
How to do it?
Hi @SleepShadowWeb, this is not possible. I know what you want. A web server with the port is initialized when is the framework started. So you can't change the port.
Only way how to handle it: run multiple apps on different ports. Can you write me why do you need this?
Thanks.
Simple reason:
- query processing third-party services running on its ports + your code works on the other ports
- maybe division security rights
I understand what you want but this is not possible. As I wrote, the framework runs on the one port and you can't change this port when is the framework running. You have to create master process with child total.js applications which they will run on different ports.
Sorry :-(
I understood it all. you just wrote: Can you write me why do you need this? so I said)
Thanks for the answer!
Yes, you're right. Thanks.
"The IP address and the PORT is already in use. You must change the PORT's number or IP address."
this is the error message it gives me. i was just testing projects dowloaded from github...
i started the first project but i cannot try the second one because the port and the ip adress are already in use... help please
Stop the first app and the second will work or change the default port in the config. It's all in the documentation https://docs.totaljs.com/latest/en.html#api~FrameworkConfiguration