pushpin on Google Compute Engine, backend on Google Apple Engine
ricardovf opened this issue · 1 comments
My backend runs on node.js on GAE. Using ws over http.
I installed pushpin on a Compute Engine instance and configured it. I can connect via ws to the 7999 port, but i get 502 error. I think there is something to do with over_http configuration, sending the request to the google app engine (only accepts https).
routes:
- xxxxxx.appspot.com:443,over_http,ssl,insecure
wscat -c 'ws://xx.xx.xx.xx:7999/ws-dual-devices?deviceUUID=22c33b4dd97e'
im getting 404.
Any tips?
bash
# tail /var/log/pushpin/pushpin-proxy.log
[DEBUG] 2020-02-05 18:36:41.064 zhttp client: OUT {ad25aaa7-45c3-4266-8c67-17ee6df5002e} { "id": "1a0aba45-4a1a-454
6-a304-e0f0f1bb686d", "seq": 1, "from": "pushpin-proxy_30459" } 6 "OPEN\x0d\n"
[DEBUG] 2020-02-05 18:36:41.080 zhttp/zws client: IN pushpin-proxy_30459 { "id": "1a0aba45-4a1a-4546-a304-e0f0f1bb6
86d", "seq": 1, "reason": "Not Found", "code": 404, "from": "{ad25aaa7-45c3-4266-8c67-17ee6df5002e}", "headers": [
[ "Content-Length", "1551" ], [ "Content-Type", "text/html; charset=UTF-8" ], [ "Date", "Wed, 05 Feb 2020 21:36:41
GMT" ] ] } 1551 "<!DOCTYPE html>\n<html lang=en>\n <meta charset=utf-8>\n <meta name=viewport content=\"initial-s
cale=1, minimum-scale=1, width=device-width\">\n <title>Error 404 (Page not found)!!1</title>\n <style>\n *{ma
rgin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin
:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/err
ors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11...go_color_150x54dp.png) 0}}@media only screen an
d (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo
_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150p
x}\n </style>\n <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n <p><b>404.</b> <ins>That
\xe2\x80\x99s an error.</ins>\n <p>The requested URL was not found on this server. <ins>That\xe2\x80\x99s all we
know.</ins>\n"
[DEBUG] 2020-02-05 18:36:41.080 wsproxysession: 0x556310a94020 target error state=1, condition=5
[DEBUG] 2020-02-05 18:36:41.080 zws server: OUT m2zws_30457 { "id": "pushpin-m2-7999_1_0", "seq": 0, "reason": "Not
Found", "condition": "rejected", "code": 404, "from": "pushpin-proxy_30459", "type": "error", "headers": [ [ "Cont
ent-Length", "1551" ], [ "Content-Type", "text/html; charset=UTF-8" ], [ "Date", "Wed, 05 Feb 2020 21:36:41 GMT" ]
] } 1551 "<!DOCTYPE html>\n<html lang=en>\n <meta charset=utf-8>\n <meta name=viewport content=\"initial-scale=1,
minimum-scale=1, width=device-width\">\n <title>Error 404 (Page not found)!!1</title>\n <style>\n *{margin:0;
padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% aut
o 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/rob
ot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11...go_color_150x54dp.png) 0}}@media only screen and (-web
kit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_
150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n <
/style>\n <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n <p><b>404.</b> <ins>That\xe2\x8
0\x99s an error.</ins>\n <p>The requested URL was not found on this server. <ins>That\xe2\x80\x99s all we know.</
ins>\n"
[INFO] 2020-02-05 18:36:41.080 GET ws://xx.xx.xx.xx:7999/ws-dual-devices?deviceUUID=22c33b4dd97e
dd97e -> xxxxxxxx.appspot.com:443[http] code=404 1551
[DEBUG] 2020-02-05 18:36:41.080 stats: OUT conn { "id": "d3356fa4-7e43-4ff2-bb0e-e831b70dca28", "from": "pushpin-pr
oxy_30459", "unavailable": true }
[DEBUG] 2020-02-05 18:36:41.080 zhttp/zws server: IN stream { "credits": 1551, "id": "pushpin-m2-7999_1_0", "seq":
1, "from": "m2zws_30457", "type": "credit" }
[DEBUG] 2020-02-05 18:36:41.081 zhttp/zws server: received message for unknown request id, canceling
[DEBUG] 2020-02-05 18:36:41.081 zhttp/zws server: OUT m2zws_30457 { "id": "pushpin-m2-7999_1_0", "from": "pushpin-p
roxy_30459", "type": "cancel" }
[DEBUG] 2020-02-05 18:36:41.158 stats: OUT activity { "count": 1, "from": "pushpin-proxy_30459" }
```
Thanks for your patience on this matter.
You haven't described much about how your server side code is set up, but when you connect to ws://xx.xx.xx.xx:7999/ws-dual-devices?deviceUUID=22c33b4dd97e, the https URL you should expect to be proxied to is https://xx.xx.xx.xx:7999/ws-dual-devices?deviceUUID=22c33b4dd97e.
I suspect the problem is the host header being sent by the websocket client (potentially of the form "xx.xx.xx.xx"). By default, pushpin makes an identical request to the target. This is not only the path and query params, but also the headers, including the Host
header. So potentially, this is not being understood by GAE which no doubt uses the host header subdomain to figure out which app to route to.
I might guess that an earlier log entry shows pushpin routing to a URL that Google App Engine isn't understanding. In this case, you should use the host
target parameter to fix this.
* xxxxxx.appspot.com:443,over_http,ssl,insecure,host=xxxxxx.appspot.com
Hope this helps.