fix: 调整 novnc websocket path
This commit is contained in:
@@ -22,7 +22,7 @@ import java.nio.ByteBuffer;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
|
||||
@Component
|
||||
public class EnvironmentWebSocketHandler extends TextWebSocketHandler {
|
||||
public class EnvironmentNovncWebSocketHandler extends TextWebSocketHandler {
|
||||
private static final Log log = Log.get();
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ public class EnvironmentWebSocketHandler extends TextWebSocketHandler {
|
||||
|
||||
private IEnvironmentSessionService environmentSessionService;
|
||||
|
||||
public EnvironmentWebSocketHandler(IEnvironmentService environmentService, IEnvironmentSessionService environmentSessionService) {
|
||||
public EnvironmentNovncWebSocketHandler(IEnvironmentService environmentService, IEnvironmentSessionService environmentSessionService) {
|
||||
this.environmentService = environmentService;
|
||||
this.environmentSessionService = environmentSessionService;
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import org.springframework.web.util.UriTemplate;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class WebSocketInterceptor extends HttpSessionHandshakeInterceptor {
|
||||
public class EnvironmentNovncWebSocketInterceptor extends HttpSessionHandshakeInterceptor {
|
||||
private static final Log log = Log.get();
|
||||
|
||||
@Override
|
||||
@@ -20,8 +20,8 @@ public class WebSocketConfig implements WebSocketConfigurer {
|
||||
|
||||
@Override
|
||||
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
|
||||
registry.addHandler(new EnvironmentWebSocketHandler(deviceService, environmentSessionService), "/api/v1/env/{envId}/session/{sessionId}/novnc")
|
||||
.addInterceptors(new WebSocketInterceptor())
|
||||
registry.addHandler(new EnvironmentNovncWebSocketHandler(deviceService, environmentSessionService), "/api/v1/env/{envId}/session/{sessionId}/novnc")
|
||||
.addInterceptors(new EnvironmentNovncWebSocketInterceptor())
|
||||
.setAllowedOrigins("*");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,9 +70,9 @@ public class Constants {
|
||||
|
||||
|
||||
/**
|
||||
* env api websocket path
|
||||
* env api novnc websocket path
|
||||
*/
|
||||
public static final String ENV_API_WEBSOCKET_PATH = "/api/v1/env/websocket";
|
||||
public static final String ENV_API_WEBSOCKET_PATH = "/api/v1/env/novnc";
|
||||
|
||||
public static final String ENV_API_TCPDUMP_PATH = "/api/v1/env/pcap";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user