Unable to connect socket from iOS to Meteor Webapp Server 1.3.5

Hi everyone,

i have deployed my meteor app on development server (Amazon EC2 server) using following cmd

meteor --settings file.json

i have tried using Objective-C DDP and Meteor-iOS library in my iOS app for getting connected with the server but unfortunately i am not able to any success in it till now

getting error of handshake or etc … i have disabled websockets on the server and trying to work out with sockjs

currently my meteor webapp version is 1.3.5.

if i am missing any thing please let me know about it

If you’re deploying to AWS, you should use mup instead of manually deploying and starting a development server. Maybe this helps. A development server of Meteor will run on port 3000, but you’ll probably want it to run on port 80. Also, you have to assure (via the instance settings of EC2) that your port 80 is open.

1 Like

@waldgeist thanks for the reply and good suggestion

i will try using mup for deploying and setting development on server AWS as it will be also helpful in deploying on production but at the moment i have already handled the port forwarding in httpd-vhosts.conf file on the development server

all the request are going to meteor and i forgot to mention about SSL is already being used and i am handling request on 443 port

but we are unable to get handshake with the server in iOS app even though we have tried out Objective DDP and Meteor IOS

is there any other specific settings or build config needed for it ?

Have you tried connecting via wss:// directly to make sure it’s getting the request? Maybe log the onconnect requests on the server/client to see anything. Just a random thought

Hi @sbr464

yes i have tried connecting via wss:// and ws:// from iOS app its not working out

is it possible that Cloudflare is creating some issue as i have read is some posts regarding to cloudflare and meteor issue on socket

http://web.archive.org/web/20160319003812/https://meteorhacks.com/cloudflare-meets-meteor

and they are suggesting either disable socket or create subdomain and point ddp on it … but these posts are quite old

and now cloudflare does support SSL on websocket which was not available at the time of the posts

currently receiving following error on socket

WebSocket connection to ‘ws://example.com/sockjs/477/z3heiyow/websocket’ failed: Error during WebSocket handshake: Unexpected response code: 400

1 Like

i have found the issue and fixed it

the issue was related to Apache version 2.2 on AWS centOS server … as it doesn’t support socket without installing specific packages on it … but i was not able to get much help on it so i changed my server instance to Ubuntu and updated the Apache to 2.4 version in which sockets module was available

2 Likes

Or use nginx, which works out of the box with Meteor sockets.