hhac

Tutorial Web Socket

Feb 23rd, 2023
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # I run this with Maven and JDK 17 on an Ubuntu Server Virtual Machine
  2. # Essentially you only need Maven and the repo.
  3. # If you are running this in a local machine and have Maven and Java 17 installed, skip until step 6
  4.  
  5. # 1. Update and upgrade
  6. sudo apt update -y
  7. sudo apt upgrade -y
  8.  
  9. # 2. Just In case (optional)
  10. sudo apt build-essential -y
  11.  
  12. # 3. When I cloned it today, Spring Boot Server Project was using for this Java version
  13. # Install java 17
  14. sudo apt install openjdk-17-jdk openjdk-17-jre -y
  15.  
  16. # 4. By default the WebSocket server port is 8080
  17. # You need to open this ports
  18. sudo ufw enable
  19. sudo ufw allow 8080
  20. sudo ufw allow 22 # in case you are using ssh
  21.  
  22. # 5. I used maven in order to run the server
  23. sudo apt install maven
  24.  
  25. # 6. Clone the repo with git and go to the complete directory
  26. git clone https://github.com/spring-guides/gs-messaging-stomp-websocket.git
  27. cd complete
  28.  
  29. # 7. Run the websocket server
  30. mvn spring-boot:run
  31.  
  32. # 8. Open the explorer in with url http://<IP-ADDRESS>:8080
  33. # Example:
  34. # http://localhost:8080 - For localhost setup
  35. # http://192.168.0.18:8080 - For Virtual Machine
Add Comment
Please, Sign In to add comment