openshift_在WildFly和OpenShift上的WebSocket聊天
生活随笔
收集整理的這篇文章主要介紹了
openshift_在WildFly和OpenShift上的WebSocket聊天
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
openshift
聊天是解釋WebSocket的最典型示例之一。 它是一個相當常用的界面,可以很容易地解釋WebSocket的基本概念。 當然,Java EE 7 WebSocket也有一個, 在這里可用 ! 您可以使用以下步驟在WildFly上輕松運行它:
然后訪問http:// localhost:8080 / chat / 。
WebSocket的最大優點之一是如何在與HTTP(在本例中為8080)相同的端口上打開套接字。 如果要將此應用程序部署到OpenShift,則可在端口8000上使用WebSocket進行常規訪問,而在端口8443上進行安全訪問。 下圖對此進行了解釋:
如果要在OpenShift上運行此Chat應用程序,請使用以下步驟:
至:
var wsUri = "ws://" + document.location.hostname + ":8000" + document.location.pathname + "chat";這將輸出顯示為:
Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 6.88 KiB | 0 bytes/s, done. Total 4 (delta 1), reused 0 (delta 0) remote: Stopping wildfly cart remote: Sending SIGTERM to wildfly:285130 ... remote: Building git ref 'master', commit 05a7978 remote: Preparing build for deployment remote: Deployment id is 14bcec20 remote: Activating deployment remote: Deploying WildFly remote: Starting wildfly cart remote: Found 127.2.87.1:8080 listening port remote: Found 127.2.87.1:9990 listening port remote: /var/lib/openshift/544f08a850044670df00009e/wildfly/standalone/deployments /var/lib/openshift/544f08a850044670df00009e/wildfly remote: /var/lib/openshift/544f08a850044670df00009e/wildfly remote: CLIENT_MESSAGE: Artifacts deployed: ./ROOT.war remote: ------------------------- remote: Git Post-Receive Result: success remote: Activation status: success remote: Deployment completed with status: success To ssh://544f08a850044670df00009e@chatserver-milestogo.rhcloud.com/~/git/chatserver.git/ 454bba9..05a7978? master -> master現在,您的聊天服務器可以從以下位置獲得: http : //chatserver-milestogo.rhcloud.com ,看起來像:
請享用!
翻譯自: https://www.javacodegeeks.com/2014/10/websocket-chat-on-wildfly-and-openshift.html
openshift
總結
以上是生活随笔為你收集整理的openshift_在WildFly和OpenShift上的WebSocket聊天的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 氢氧化钙是沉淀吗 氢氧化钙是不是沉淀
- 下一篇: 衣品是什么意思 衣品意思介绍