deploying-unreal-engine-pixel-streaming-server-on-ec2 icon indicating copy to clipboard operation
deploying-unreal-engine-pixel-streaming-server-on-ec2 copied to clipboard

How to use AWS certificates to serve Pixel Streaming in https?

Open notdanilo opened this issue 3 years ago • 25 comments

We need to serve the Pixel Streaming in an iframe inside our page served via HTTPS. But due to the browser's security policy, we need to load the Pixel Streaming page as HTTPS as well.

How can we get the key.pem and cert.pem files from AWS certificates?

notdanilo avatar Apr 13 '21 12:04 notdanilo

BUMP. I also need this as well. Also trying to do an iframe embed.

NovySan avatar Jul 18 '21 17:07 NovySan

Hi @NovySan. I discovered that it's possible to create a load balancer to redirect https requests to http only instances.

notdanilo avatar Jul 21 '21 15:07 notdanilo

Hi @NovySan. I discovered that it's possible to create a load balancer to redirect https requests to http only instances.

Does that allow you to load in an iframe? Can you share how this is done?

NovySan avatar Jul 21 '21 15:07 NovySan

@NovySan I will try to explain it with what I remember:

Let's say you have an ec2 machine which you can access with the address http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com/ You can create an iframe pointing to it to access the page if the hosting page is served as HTTP.

In ec2, it's possible to create a https://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com load balancer to point to http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com, which can then can be served as https and used in an iframe in a https hosting page. (it ofc requires a few things like creating the aws certificate and other things, but it's pretty straightforward)

I can go through my project to answer any question you have, but I suggest you to give it a try first because it will consume a bit of my time to get my credentials back.

notdanilo avatar Jul 21 '21 15:07 notdanilo

I'll give it a try! Thanks.

On Wed, Jul 21, 2021 at 11:58 AM Danilo Guanabara @.***> wrote:

@NovySan https://github.com/NovySan I will try to explain it with what I remember:

Let's say you have an ec2 machine which you can access with the address http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com/ You can create an iframe pointing to it to access the page if the hosting page is served as HTTP.

In ec2, it's possible to create a https load balancer to point to http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com, which can now can be served as https and used in an iframe in a https hosting page.

I can go through my project to answer any question you have, but I suggest you to give it a try first because it will consume a bit of my time to get my credentials back.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws-samples/deploying-unreal-engine-pixel-streaming-server-on-ec2/issues/8#issuecomment-884302762, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMHCLTCVBNHUVW7Z5PDWVLTY3VEBANCNFSM423HYUYQ .

NovySan avatar Jul 21 '21 16:07 NovySan

Just wondering if you had success or found another solution?

davidburtonSGS avatar Oct 28 '21 19:10 davidburtonSGS

@NovySan I will try to explain it with what I remember:

Let's say you have an ec2 machine which you can access with the address http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com/ You can create an iframe pointing to it to access the page if the hosting page is served as HTTP.

In ec2, it's possible to create a https://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com load balancer to point to http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com, which can then can be served as https and used in an iframe in a https hosting page. (it ofc requires a few things like creating the aws certificate and other things, but it's pretty straightforward)

I can go through my project to answer any question you have, but I suggest you to give it a try first because it will consume a bit of my time to get my credentials back.

Does this solution still work with an iframe?

Noah670 avatar Jan 05 '22 22:01 Noah670

Yes

On Thu, Jan 6, 2022 at 11:24 AM Noah @.***> wrote:

@NovySan https://github.com/NovySan I will try to explain it with what I remember:

Let's say you have an ec2 machine which you can access with the address http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com/ You can create an iframe pointing to it to access the page if the hosting page is served as HTTP.

In ec2, it's possible to create a https://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com load balancer to point to http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com, which can then can be served as https and used in an iframe in a https hosting page. (it ofc requires a few things like creating the aws certificate and other things, but it's pretty straightforward)

I can go through my project to answer any question you have, but I suggest you to give it a try first because it will consume a bit of my time to get my credentials back.

Does this solution still work with an iframe?

— Reply to this email directly, view it on GitHub https://github.com/aws-samples/deploying-unreal-engine-pixel-streaming-server-on-ec2/issues/8#issuecomment-1006126196, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5GSMSINTFU4AXNTTZ5RN3UUTAKTANCNFSM423HYUYQ . You are receiving this because you are subscribed to this thread.Message ID: <aws-samples/deploying-unreal-engine-pixel-streaming-server-on-ec2/issues/8/1006126196 @github.com>

lukas-kyeso avatar Jan 05 '22 23:01 lukas-kyeso

@NovySan I will try to explain it with what I remember:

Let's say you have an ec2 machine which you can access with the address http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com/ You can create an iframe pointing to it to access the page if the hosting page is served as HTTP.

In ec2, it's possible to create a https://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com load balancer to point to http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com, which can then can be served as https and used in an iframe in a https hosting page. (it ofc requires a few things like creating the aws certificate and other things, but it's pretty straightforward)

I can go through my project to answer any question you have, but I suggest you to give it a try first because it will consume a bit of my time to get my credentials back.

Hi I tried to this few times but it never worked for me. I must have messed up load balancer/target group/certificate.. bla bla.. Anyway, a tutorial would be greately appreciated.

Many thanks in advance

DrRaedAbbas avatar Mar 12 '22 01:03 DrRaedAbbas

@notdanilo Have you tried the ready-made MetaEditor solution on React.js to demonstrate Unreal Engine in a browser with Pixel Streaming technology?

markolofsen avatar Mar 19 '22 06:03 markolofsen

Hello guys is there a way to get the whole thing running via ssl? The pixel streaming is accessible via http, but not with Https.

DamianMal avatar Apr 22 '22 13:04 DamianMal

Hello guys is there a way to get the whole thing running via ssl? The pixel streaming is accessible via http, but not with Https.

I too am looking for a solution for that

RaedAbbas avatar Apr 23 '22 08:04 RaedAbbas

I am trying to get that working as well. There is a setting in the config.json file that is useHTTPS, which I set to true. I have also edited cirrus.js to reference our SSL certificate. The signaling server runs, but we don’t see: Streamer connected: ::1, meaning the app isn’t connected to the signaling server. Am I missing something?

amhep avatar May 04 '22 14:05 amhep

We have the whole thing running on AWS. We tried the setup with an external domain. However, LoadBlanacer did not accept the certificates. For testing we bought a domain directly via AWS. With this everything works.... Maybe this helps you.

DamianMal avatar May 10 '22 10:05 DamianMal

We have the whole thing running on AWS. We tried the setup with an external domain. However, LoadBlanacer did not accept the certificates. For testing we bought a domain directly via AWS. With this everything works.... Maybe this helps you.

When you say that you bought a domain directly, does that mean that you are routing the traffic through that domain to the instance?

xxEoD2242 avatar Nov 07 '22 11:11 xxEoD2242

I am trying to get that working as well. There is a setting in the config.json file that is useHTTPS, which I set to true. I have also edited cirrus.js to reference our SSL certificate. The signaling server runs, but we don’t see: Streamer connected: ::1, meaning the app isn’t connected to the signaling server. Am I missing something?

Facing the same issue. Did you get a work around?

arunvaswani1 avatar Dec 06 '22 16:12 arunvaswani1

I am trying to get that working as well. There is a setting in the config.json file that is useHTTPS, which I set to true. I have also edited cirrus.js to reference our SSL certificate. The signaling server runs, but we don’t see: Streamer connected: ::1, meaning the app isn’t connected to the signaling server. Am I missing something?

Hi @amhep. I'm having the exact same problem. Where you able to solve it? Thanks!

Monthag avatar Jan 04 '23 23:01 Monthag

Hi @kashman-amzn. Are you familiar with this issue? Maybe you can shed some light for us. Thanks!

Monthag avatar Jan 06 '23 18:01 Monthag

Hi Everyone! Solved it using ngrok. Not sure if that's the best solution

arunvaswani1 avatar Jan 06 '23 18:01 arunvaswani1

That's great! Can you elaborate? The fact that the streamer can't connect is because the UE game is not connecting to the Signalling Server. How did you use ngrok to solve it?

Monthag avatar Jan 06 '23 19:01 Monthag

Hey, well keep the standard settings of pixel streaming, in Ngrok set the forwarding https to the http link...

arunvaswani1 avatar Jan 07 '23 12:01 arunvaswani1

hey @arunvaswani1 Thanks for the help! It worked like a charm. Cheers!

Monthag avatar Jan 08 '23 17:01 Monthag

hi, i resolve https with ngrok, but the site is stack on starting connection, ice candidate from one client (to other not) stack in starting connection, it is possibile i should using a external turn server solution ?

NatakuZ avatar Oct 13 '23 06:10 NatakuZ

Hey I found the solution by my colleagues. I used Cloudfront in front of Web signaling server for http redirect to https. You need to set http only on Origin tab and redirect http to https on Behavior tab. And it worked well! And ALB in front of web signaling server works well too. However, if matchmaker is in front of web singaling server, I don't know workaround. If someone else know how to apply certificate in aws ec2, tell me please.

hheungsu74 avatar Dec 14 '23 14:12 hheungsu74

@NovySan I will try to explain it with what I remember: Let's say you have an ec2 machine which you can access with the address http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com/ You can create an iframe pointing to it to access the page if the hosting page is served as HTTP. In ec2, it's possible to create a https://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com load balancer to point to http://ec2-xxx-xxx-xxx-xxx.sa-east-1.compute.amazonaws.com, which can then can be served as https and used in an iframe in a https hosting page. (it ofc requires a few things like creating the aws certificate and other things, but it's pretty straightforward) I can go through my project to answer any question you have, but I suggest you to give it a try first because it will consume a bit of my time to get my credentials back.

Hi I tried to this few times but it never worked for me. I must have messed up load balancer/target group/certificate.. bla bla.. Anyway, a tutorial would be greately appreciated.

Many thanks in advance

It works well.

hheungsu74 avatar Dec 18 '23 00:12 hheungsu74