GitLab wurde aktualisiert. Dank regelmäßiger Updates bleibt das THM GitLab sicher und Sie profitieren von den neuesten Funktionen. Vielen Dank für Ihre Geduld.

Commit 31e5db05 authored by Paul-Christian Volkmer's avatar Paul-Christian Volkmer
Browse files

Feature #3937: Create action providing socket url

parent d2b365da
......@@ -90,4 +90,15 @@ public class SessionController {
response.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value());
return null;
}
@RequestMapping(value="/socketurl", method=RequestMethod.GET)
@ResponseBody
public String getSocketUrl() {
StringBuilder url = new StringBuilder();
url.append(server.isUseSSL() ? "https://" : "http://");
url.append(server.getHostIp() + ":" + server.getPortNumber());
return url.toString();
}
}
......@@ -37,13 +37,13 @@ public class ARSnovaSocketIOServer {
private final ConcurrentHashMap<UUID, User> socketid2user = new ConcurrentHashMap<UUID, User>();
private int portNumber;
private String hostIp;
private boolean useSSL = false;
private String keystore;
private String storepass;
private final Configuration config;
private SocketIOServer server;
public ARSnovaSocketIOServer() {
config = new Configuration();
}
......@@ -55,7 +55,7 @@ public class ARSnovaSocketIOServer {
System.setProperty("java.net.preferIPv4Stack" , "true");
config.setPort(portNumber);
config.setHostname("0.0.0.0");
config.setHostname(hostIp);
if(useSSL) {
try {
InputStream stream = new FileInputStream(keystore);
......@@ -140,6 +140,14 @@ public class ARSnovaSocketIOServer {
this.portNumber = portNumber;
}
public String getHostIp() {
return hostIp;
}
public void setHostIp(String hostIp) {
this.hostIp = hostIp;
}
public String getStorepass() {
return storepass;
}
......
......@@ -64,7 +64,7 @@
<bean id="socketServer" class="de.thm.arsnova.socket.ARSnovaSocketIOServer"
init-method="startServer" destroy-method="stopServer" scope="singleton"
p:portNumber="10443" p:useSSL="${security.ssl}" p:keystore="${security.keystore}"
p:portNumber="${socketio.port}" p:hostIp="${socketio.ip}" p:useSSL="${security.ssl}" p:keystore="${security.keystore}"
p:storepass="${security.storepass}" />
</beans>
......@@ -19,4 +19,7 @@ feedback.cleanup=10
couchdb.host=localhost
couchdb.port=5984
couchdb.name=arsnova
\ No newline at end of file
couchdb.name=arsnova
socketio.ip=0.0.0.0
socketio.port=10443
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment