Is there a way to get port of embedded http server from code? My load balancers should send to clients data about alive game servers in cluster: ip, port and httpPort (is blurBox is enable).
It'll be great if there will be method "getHttpPort()" in com.smartfoxserver.v2.http.IHttpServer class
embedded http server port? how to get?
At the moment no, but we're adding it in the next release
For now the only way is to parse the config/jetty.xml file.
It can be done easily:
Open the file with the FileUtils class included in the Apache commons library included in SFS2X
Then look for this line:
You can search the "jetty.port" ID and then grab the port with a bit of String manipulation
Hope it helps
For now the only way is to parse the config/jetty.xml file.
It can be done easily:
Open the file with the FileUtils class included in the Apache commons library included in SFS2X
Then look for this line:
Code: Select all
<SystemProperty name="jetty.port" default="8080"/>
You can search the "jetty.port" ID and then grab the port with a bit of String manipulation
Hope it helps
Who is online
Users browsing this forum: No registered users and 135 guests