fix: 调整 novnc websocket path

This commit is contained in:
zhangshuai
2024-09-11 09:39:41 +08:00
parent daf362aa0b
commit 55d374fa98
4 changed files with 7 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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("*");
}
}

View File

@@ -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";