Skip to content

Commit

Permalink
Issue #6 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita committed May 15, 2012
1 parent 73a9868 commit cad090f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/main/java/com/corundumstudio/socketio/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

public class Configuration {

private String context = "/socket.io";

private Executor bossExecutor = Executors.newCachedThreadPool();
private Executor workerExecutor = Executors.newCachedThreadPool();

Expand Down Expand Up @@ -148,4 +150,11 @@ public int getCloseTimeout() {
return closeTimeout;
}

public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class SocketIOPipelineFactory implements ChannelPipelineFactory, Disconne
private final Logger log = LoggerFactory.getLogger(getClass());

private final int protocol = 1;
private final String connectPath = "/socket.io/" + protocol + "/";

private final AuthorizeHandler authorizeHandler;
private XHRPollingTransport xhrPollingTransport;
Expand All @@ -57,6 +56,8 @@ public SocketIOPipelineFactory(Configuration configuration) {
Decoder decoder = new Decoder(objectMapper);
PacketListener packetListener = new PacketListener(socketIOHandler, this, heartbeatHandler);

String connectPath = configuration.getContext() + "/" + protocol + "/";

packetHandler = new PacketHandler(packetListener, decoder);
authorizeHandler = new AuthorizeHandler(connectPath, socketIOHandler, configuration);
xhrPollingTransport = new XHRPollingTransport(connectPath, this, heartbeatHandler, authorizeHandler, configuration);
Expand Down

0 comments on commit cad090f

Please sign in to comment.