WebSocket with Spring Boot and Java | Build a Chat App

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 9

  • @PrashantPujari-q9e
    @PrashantPujari-q9e 3 месяца назад +1

    Thankyou for this. Best video on spring websocket so far.

    • @PrashantPujari-q9e
      @PrashantPujari-q9e 3 месяца назад +1

      Can you please tell me on how to switch to wss from ws using SSL. (I am using spring websocket without stomp & sockjs)

    • @Code.Wizzard
      @Code.Wizzard  3 месяца назад +1

      Thanks for your kind comments. Switching to SSL is straight forward
      For dev environment you can first create a self signed certificate using the below command. For production, it's recommended to obtain a certificate from a trusted CA.
      keytool -genkeypair -alias websocket -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore websocket.p12 -validity 3650
      Add the below to application.properties
      server.ssl.key-store=file:/websocket.p12
      server.ssl.key-store-password=
      server.ssl.keyStoreType=PKCS12
      server.ssl.keyAlias=websocket
      server.ssl.enabled=true
      After that you can access the websocket using url starting with wss://

  • @OleksandrProkopenko_ua
    @OleksandrProkopenko_ua 2 месяца назад

    its just a very good video. Thanks

    • @Code.Wizzard
      @Code.Wizzard  2 месяца назад

      Thanks for your kind feedback

  • @OleksandrProkopenko_ua
    @OleksandrProkopenko_ua 2 месяца назад +1

    but i have a question: so how we can test 2nd version of your example with postman? Is it absolutly impossible? or is it just hard and inconveniently?

    • @Code.Wizzard
      @Code.Wizzard  2 месяца назад

      Since the second one uses STOMP protocol on top of Websocket, I think it might not work since there are no options in postman to enable that. Will try to explore more.

    • @OleksandrProkopenko_ua
      @OleksandrProkopenko_ua 2 месяца назад

      @@Code.Wizzard so it is a case to create simple html page to test your backend app, right?
      Or maybe is there an ability to write integration tests for this purpose?

    • @Code.Wizzard
      @Code.Wizzard  2 месяца назад +1

      @@OleksandrProkopenko_ua correct, either can test it from a UI or write integration test using WebSocketStompClient