Domanda

I have a service that streams content from google compute engine and I would like to stream from Europe's servers if the user is from Europe or Africa and from the US if the user is from anywhere else. Or even better, if a service could define the best zone to serve the user, it would be great!

Is that a way to do that automatically with google compute engine or do I have to manually build a solution? 

Thanks for your help!

È stato utile?

Soluzione 3

Actually I found another solution more appropriate for my use case. I put it here in case other people have the same issue.

So my use case was to stream binary data through websocket (soundfonts for the audio player on Jellynote.com) Instead of having one URL that redirects to the nearest servers according to the user IP, I have a pool of URL (for now 2, one in the US and one in UE). I create a connexion with all the URL un the pool and I keep only the first one to respond (the nearest obviously). Quite simple actually. :)

for host in @hosts
    connection = new WebSocket "ws://#{ host }"
    connection.onopen = (e) => #close every other connection

Altri suggerimenti

With what's currently available in Google Compute Engine, you'd still need to resort to some additional technique (such as DNS service or geo-ip web server plugin).

If your contents are static and you own the rights, you may consider putting it on Google Cloud Storage (or even Youtube) and it will figure out what's the quickest way to serve a client request based on the location.

One option would be to create a small redirect service in Google App Engine. App Engine HTTP requests are annotated with location information inferred from the client's IP address: Request Headers

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top