發表文章

目前顯示的是 11月, 2016的文章

STOMP/MQTT 通訊協定的測試心得(client/server)

圖片
STOMP 通訊協定的測試心得(client/server) STOMP 是啥東西?  STOMP 是 Simple (or Streaming) Text Oriented Message Protocol 的縮寫 主要提供一個可以操作的通訊界面,可以支援不同平台的的客戶端交換文字訊息。它屬於一個訊息導向的中介軟體。這個服務類似 HTTP ,並且架構於 TCP 上面。 ref: https://segmentfault.com/a/1190000004906137 功能示意圖 用來搭建 IM (即時通訊服務) 是很簡單好用的中介工具 https://segmentfault.com/a/1190000004906137  這裡有目前常見的訊息中介軟體的比較介紹 amqp mqtt or stomp http://blogs.vmware.com/vfabric/2013/02/choosing-your-messaging-protocol-amqp-mqtt-or-stomp.html 建議和 html5 websocket 一起看,比較容易理解它到底再做啥? P66 頁開始。 http://www.slideshare.net/peterlubbers/html5-real-time-and-websocket/94-Learn_More_HTML5_User_Groups 這裡有 function 功能規格說明 https://mq.java.net/4.4-content/stomp-funcspec.html 這個大概就是目前的官方網站了 https://github.com/stomp-php/stomp-php/wiki 這個服務主要構過 broker 來提供服務,目前 broker 的軟體有很多種可以提供。 broker -- STOMP Servers broker -- STOMP Servers 的列表,常用的。 https://stomp.github.io/implementations.html 我裡以 apache apollo 這套 activemq 的子專案,來做說明。 Apollo 1.7.1 版本,下載我是以 Linux 版來說明 http:...

Enom DNS 服務的動態 dns 更新

圖片
Enom DNS 服務的動態 dns 更新 圖跟內文無關 最近因為工作關係,租了一台韓國的 aws 主機來當 vpn 服務,想說 ip 也不想固定,弄個動態 ip 更新好了。我的 dns 主機商是 enom 他在網路上有很多的自動更新的 script。 先提供一個有趣的網站,這網站可以用命令列反查所在的對外 public ip 很適合用來寫程式。 https://ifconfig.co/ 命令列及 API 版本的 myip address 另外有一個網站 https://www.ipip.net/ 可以查詢每個 ip 的所在地,是一個很好用的服務。 另外也提供 api 接入的功能,可以很方便的接程式。 官方網站提供的程式,右方有各種平台用的。 http://www.enom.com/help/faq_dynamicdns.asp  下面是在 github 找到的,其實重點在 enom api server 提供的服務,每個程式只是包裝了一些個人化的需求。 Enom api server ENOMURL="http://dynamic.name-services.com" python version: https://gist.github.com/stef-levesque/11229362 shell version: https://gist.github.com/h0tw1r3/11405624 php version: https://github.com/mrubinsk/phpEnomUpdate/blob/master/phpEnomUpdate.php php 最簡單版本的 update. https://gist.github.com/agarzon/2431219 // -------------------------------------------- # php 版本的更新程式 [root@ip-172-31-12-22 enom]# cat /root/enom/ip-update.php #!/usr/bin/php /* Run this script every 5 minutes (or 1 hour, is up to...