These are chat archives for fanout/pushpin

28th
Nov 2018
Mohamed El-Feky
@reve99
Nov 28 2018 07:25
Hello @jkarneges , As i have been telling you, i was trying SSE , Web Sockets , Web Sockets over http
i failed to implement Web Sockets over http
using both Node or php
this is my config/routes content
  • localhost:80,overhttp
Mohamed El-Feky
@reve99
Nov 28 2018 09:31
Tried to use express-grip
following examples you provided but failed
https://www.npmjs.com/package/express-grip
also tried to use hapi , implemented streaming and websockets successfully , but not websockets over http
i can provide my code when you need it @jkarneges
Jorge S. Cuesta
@jorgecuesta
Nov 28 2018 13:15
@reve99 Hi here is a sample of my working code with Hapi.js 16+ and Pushpin
maybe that code could help you to put as a Hapi.js plugin, also check the first lines that have a little comment about route file. I see you write * localhost:80,overhttp and have a typo, because it should be * localhost:80,over_http
Mohamed El-Feky
@reve99
Nov 28 2018 16:59
thanks, will try it first thing tomorrow and give u my feedback, most propably it's the typo over_http
Mohamed El-Feky
@reve99
Nov 28 2018 17:14
i need to ask you about those two lines
if (internals.registerFlag === false) {
internals.registerFlag = true;
where should internals be defined ?
Jorge S. Cuesta
@jorgecuesta
Nov 28 2018 17:16
const internals = {
  registerFlag: false,
};
is to prevent to add that block a lot of time if you register same plugins multiple times
Mohamed El-Feky
@reve99
Nov 28 2018 17:16
just didn't notice it in the file
ok
Jorge S. Cuesta
@jorgecuesta
Nov 28 2018 17:17
yes sorry my bad, I don’t copy paster that line, I just remove all my service logic with graphql
because that does not mather for you
usually if you see the best practice of hapi.js they recommend to define as “module” const and internals object to store there any “plugin” things
This message was deleted
Mohamed El-Feky
@reve99
Nov 28 2018 17:21
ok , will do
Mohamed El-Feky
@reve99
Nov 28 2018 17:35
still not working , to make sure everything is working , can you provide me the full sample
the module you sent and the server that use it
Jorge S. Cuesta
@jorgecuesta
Nov 28 2018 17:35
give a while to prepare it
Mohamed El-Feky
@reve99
Nov 28 2018 17:35
will wait for you
Jorge S. Cuesta
@jorgecuesta
Nov 28 2018 17:35
also I use Docker with docker-compose
Mohamed El-Feky
@reve99
Nov 28 2018 17:36
that would be greate ,if it's much to do , just let the server work on port 8080
thanks in advance
Jorge S. Cuesta
@jorgecuesta
Nov 28 2018 17:36
sure
Jorge S. Cuesta
@jorgecuesta
Nov 28 2018 20:34
@reve99 :point_up:
I made a hapi.js server with the plugin loaded. It is working on localhost:8080
so you should point your websocket to ws://localhost:7999/ws
so pushpin will redirect to http://localhost:8080/ws
you should put your route file with something like * localhost:8080,over_http