Feathers: Is possible setting different port for socket.io to deploy GAE Fixble

Created on 28 Mar 2017  ·  3Comments  ·  Source: feathersjs/feathers

hi ,

I want deploy feathers to GAE Fixble ( google app engine )
Unfortunately, the loadbalancer of Google App Engine doesn't support websockets.
so , I need set socket.io listen port different with rest api ( 80 , 443 )
Is possible setting different port for sokect.io ?

thanks .

Most helpful comment

You should be able to start the REST part like this:

const http = require('http');

http.createServer(app).listen(80);

And then the socket server via:

const socketServer = http.createServer().listen(3889);

app.setup(socketServer);

Do not call app.listen.

All 3 comments

You should be able to start the REST part like this:

const http = require('http');

http.createServer(app).listen(80);

And then the socket server via:

const socketServer = http.createServer().listen(3889);

app.setup(socketServer);

Do not call app.listen.

thanks for your help , even I have some static ip to handle with socket .
but I have a first step with deploy on GAE flexible .

this is my current index.js

'use strict';

const http = require('http');
const app = require('./app');
const port = process.env.PORT || app.get('port');
const socketServer = http.createServer().listen(3889);
app.setup(socketServer);
const server = http.createServer(app).listen(port);
//  app.listen(port);

server.on('listening', () =>
  console.log(`Feathers application started on ${app.get('host')}:${port}`)
);

now I can deployed to GAE , I can call restful use http://my-app.appspot.com , call ws with ws://ip-address:3889

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vincz picture Vincz  ·  4Comments

eric-burel picture eric-burel  ·  3Comments

intumwa picture intumwa  ·  3Comments

arve0 picture arve0  ·  4Comments

Mattchewone picture Mattchewone  ·  4Comments