airbnb / hypernova

A service for server-side rendering your JavaScript views
MIT License
5.82k stars 207 forks source link

More details about server requirements for production #141

Open ductiletoaster opened 5 years ago

ductiletoaster commented 5 years ago

While trying to build out the client node machine and the "hypernova" server I had issues hitting the server from an external host. Example can be found here: https://github.com/pixeloven/typescript-react-component-library

In this example I am unable to connect the client to the server when they are running on different hosts. the express client seems to be ok being accessed "0.0.0.0:8080/health" but I can't hit the server can not ad 8081.

node-server    | { listen: [ 9001, '0.0.0.0' ] }
node-server    | 2018-09-27T22:48:47.342Z - info: Worker #7 is now connected to 0.0.0.0:9001
node-client    | {}
node-client    | Preparing MyComponent { name: 'Stranger' }
node-client    | Requesting MyComponent { name: 'Stranger' }
node-client    | Error: connect ECONNREFUSED 0.0.0.0:9001
node-client    |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
node-client    | {"level":"info","message":"HTTP GET /","meta":{"res":{"statusCode":200},"req":{"url":"/","headers":{"host":"0.0.0.0:9000","connection":"keep-alive","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","accept-encoding":"gzip, deflate","accept-language":"en-US,en;q=0.9,la;q=0.8"},"method":"GET","httpVersion":"1.1","originalUrl":"/","query":{}},"responseTime":31}}
node-client    | {"level":"info","message":"HTTP GET /favicon.ico","meta":{"res":{"statusCode":404},"req":{"url":"/favicon.ico","headers":{"host":"0.0.0.0:9000","connection":"keep-alive","user-agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36","accept":"image/webp,image/apng,image/*,*/*;q=0.8","referer":"http://0.0.0.0:9000/","accept-encoding":"gzip, deflate","accept-language":"en-US,en;q=0.9,la;q=0.8"},"method":"GET","httpVersion":"1.1","originalUrl":"/favicon.ico","query":{}},"responseTime":4}}

The above example is showing different ports but the idea is the same. the server is refusing connections.

ductiletoaster commented 5 years ago

Just realized that createApplication is't available in 2.3.0 or atleast it's not fully implemented. Either way I'm still unable to connect the two node servers together.