|
@ -1,9 +1,29 @@ |
|
|
package com.dreamworks.boditech; |
|
|
package com.dreamworks.boditech; |
|
|
|
|
|
import com.dreamworks.boditech.utils.MyWebsocketClient; |
|
|
|
|
|
import org.java_websocket.client.WebSocketClient; |
|
|
import org.springframework.boot.SpringApplication; |
|
|
import org.springframework.boot.SpringApplication; |
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|
|
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
|
|
import org.springframework.web.socket.server.standard.ServerEndpointExporter; |
|
|
|
|
|
import java.net.URI; |
|
|
|
|
|
import java.net.URISyntaxException; |
|
|
|
|
|
|
|
|
@SpringBootApplication |
|
|
@SpringBootApplication |
|
|
public class BoditechApplication { |
|
|
public class BoditechApplication { |
|
|
public static void main(String[] args) { |
|
|
public static void main(String[] args) { |
|
|
SpringApplication.run(BoditechApplication.class, args); |
|
|
SpringApplication.run(BoditechApplication.class, args); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
|
public WebSocketClient webSocketClient() throws URISyntaxException { |
|
|
|
|
|
URI uri = new URI("wss://ws.postman-echo.com/raw"); |
|
|
|
|
|
MyWebsocketClient webSocketClient = new MyWebsocketClient(uri); |
|
|
|
|
|
webSocketClient.connect(); |
|
|
|
|
|
return webSocketClient; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
|
public ServerEndpointExporter websocketServerEndpointExporter() { |
|
|
|
|
|
return new ServerEndpointExporter(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |