###前提・実現したいこと
AWSのEC2上でmilkcocoaにpush、subscribeする。
ローカルでは動作するが、AWS上だと接続もできていないようなのですが、
security groupに設定すべきip/portは合っていますか?
他に設定またはログとして出すと有用な情報があれば教えて下さい。
###発生している問題・エラーメッセージ
pushのコールバックが呼ばれない。complete, errorどちらも呼ばれない。
datastoreのオブジェクトの状態は下記の状態です。
{ option: { clientId: 'xxxxx', app_id: 'xxxxx' }, file_path: '/var/lib/mlkcca', storage: { set: [Function], get: [Function] }, host: 'xxxxxx.mlkcca.com', app_id: 'xxxxxx', listeners: { add: [Function], del: [Function], fire: [Function], get_subscribes: [Function] }, idGenerator: { init: [Function], getHeader: [Function], getNextId: [Function], _exec_getNextId: [Function], _getNextId: [Function] }, transporter: { sid: null, queue: [], error_callbacks: {}, comp_callbacks: {}, request_id: 1, app_id: 'xxxxxx', host: 'xxxxxx.mlkcca.com', port: 8883, http_port: 443, useSSL: true, qos: 0, client: { options: [Object], streamBuilder: [Function: wrapper], outgoingStore: [Object], incomingStore: [Object], pingTimer: null, connected: false, disconnecting: false, queue: [], connackTimer: [Object], reconnectTimer: null, nextId: 55390, outgoing: {}, _events: [Object], domain: null, _maxListeners: undefined, stream: [Object], onConnectionLost: [Function: n], onMessageArrived: [Function: p] }, _is_connected: false, _onMessage: [Function] }, server_ts: 1460688272631, start_ts: 1460688272631 }
###該当のソースコード
coffeescript
1# 毎回接続 2 MilkCocoa = require('milkcocoa') 3 milkcocoa = new MilkCocoa('xxxxxx.mlkcca.com') 4 console.log milkcocoa #↑の出力はここのconsole.log 5 6 ds = milkcocoa.dataStore('shutter') 7 ds.push( 8 {message: "open", user: msg.envelope.user.name}, 9 (err, pushed) -> 10 console.log pushed # ここのconsole.logは出ない 11 console.log err 12 , (err) -> 13 console.log "error" # ここのconsole.logも出ない 14 console.log err 15 )
###試したこと
tcpdumpでsource ip, dest portを確認し、使っていそうなip/portを
AWS security group設定で、下記を許可する。
- host/ip
v2-production-lb1.mlkcca.com 27.133.134.20
- port
8883
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。