Ultraviolet
Ultraviolet copied to clipboard
TypeError while running on Google Cloud Shell
I'm running this app on Google Cloud Shell Preview, and before you recommend another platform:
- Every single app host is blocked, only reason Google Cloud Shell isn't is because all Google domains have a hard coded whitelist.
- Shell Preview gives 50 hours a week of free usage
- My school trusts any google.com domain
However when deploying any Ultraviolet-based proxy, namely github.com/titaniumnetwork-dev/Ultraviolet-App and Holy Unblocker, I get the following error:
Error processing your request
Failed to load https://www.google.com/search?q=test
Internal Server Error
Code: TypeError
TypeError: Failed to fetch
Also, when deploying a simple TompHTTP bare server from NodeJs, I get the following 401 error:
RangeError: Failed to construct 'Response': The status provided (0) is outside the range [200, 599].
Issue #78 seems to have a identical problem. This is probably related to #77 and tomphttp/bare-server-node/issues/17. On the TompHTTP issue thread, it discusses setting the port visibility to public, and I may have read somewhere about Google Cloud Shell Preview requiring account authentication to access the preview, so that could be the problem, although I am not sure.
To reproduce:
- Launch Google Cloud Shell
-
$ git clone https://github.com/titaniumnetwork-dev/Ultraviolet-App.git
-
$ cd Ultraviolet-App
-
$ npm install
-
$ npm start
- Open web preview
- Go to any website
This is because of how previews work on Google cloud shell, you'd have to modify UV to make this work
Cut it out, both of you @Jokypond @ilikemen132
Cut it out, both of you @Jokypond @ilikemen132
so sorry
@ProgrammerIn-wonderland Thanks, I suspected so, but I'm not familiar with Ultraviolet internals, so if you could guide me in the right direction, I would be happy to make this on my own and submit a PR.
I'm honestly not sure where to start, it would also require understanding how Google cloud auth works, but you can give it a shot
Alright, @ProgrammerIn-wonderland I'll give it a try. I'm assuming that becuase Google Cloud Shell Preview requires authentication, the service worker that proxies requests doesn't get the requests sent.
I have been installing Ultraviolet on Deta Space. The same problem encountered. I solved it by setting public: true
, which I guess is basically the same as Gitpod's set the port visibility to public
.
So I guess this happens because Ultraviolet's request to the bare server is blocked by authentication?
update:
the service worker that proxies requests doesn't get the requests sent.
This is reasonable too. But I don't know internal of how Ultraviolet talks to bare server, or how service workers work.
Yeah pretty sure it has to do with a firewall issue
@xjzh123
So I guess this happens because Ultraviolet's request to the bare server is blocked by authentication?
Definitely. This official Google article confirms it: Cloud Shell - Preview web apps I think this could be achieved if I found the authentication headers that are necessary to make requests to the preview backend, and sent them along in the service worker proxy.
Also: How are you running on Deta Space? Just curious. Is there an app from the marketplace available or do I need to create my own app? (Which is possible, since my dev mode request did get accepted)
@xjzh123
So I guess this happens because Ultraviolet's request to the bare server is blocked by authentication?
Definitely. This official Google article confirms it: Cloud Shell - Preview web apps I think this could be achieved if I found the authentication headers that are necessary to make requests to the preview backend, and sent them along in the service worker proxy.
Also: How are you running on Deta Space? Just curious. Is there an app from the marketplace available or do I need to create my own app? (Which is possible, since my dev mode request did get accepted)
I have created UltraViolet-App and Cobalt in the marketplace, so everyone can install them on deta.
Closed as stale