Jump to content
  • 0

426 HTTPS Required


Reddoman

Question

Hi guys,

I am trying to link some data between my website and my game with the API. However, I am in need of help because I am a newbie with little to no coding experience.

 

For context, I tried digging through some old forum posts to see if I could find any existing code I could use to test out and learn from, which I eventually did (but it's not working for some reason):

In the post below, I saw that someone had written some PHP code with two functions. It kind of made sense to me because they had a function that gets the access token, as well as another function to send global messages to the game--which then takes the token when calling it. 

 


Again, I don't really know what I'm doing wrong. Maybe it's just me being a dummy? The messages aren't being sent to my game, nor am I seeing anything on my webpage through my webserver. I'm also hosting my game on a VPS.

Here's some additional info:

  • I'm using the files from Github for my server and client (not sure if I'm supposed to do that). The only reason why I did that is because I wanted to change my game's icon.
  • I tried getting the access token from the terminal window, and it worked just fine. Why am I having trouble now?
  • This is probably useless info, but I am getting this code when using Postman:
     

9c02db223c0da281e6066b96c5b23157.png
 

 

 

 

Hopefully, the smart people here can give me a hand :sweat_smile:.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Back in November 2022 changes were made to the api to require HTTPS (secure) communication for non-local api requests.

 

This means that the api requests need to originate from the local machine or at least the local network if you set 'AllowedNetworkTypes' property to 4 in api.config.json.

 

Future versions of Intersect will have the capability to setup and accept https connections on it's own, but that is still 1-2 major updates away.

 

If you require your api to be publicly accessible right now it is highly encouraged that you use an Apache or Nginx reverse proxy with an SSL certificate.

 

Please excuse the plug but for anyone using my hosting services who also  stumbles on this post I already have a reverse proxy setup for all the servers I host making this really easy for you guys. The configuration changes/connection information you need can be found here.

Link to comment
Share on other sites

  • 0

Hello @jcsnider and @Reddoman everything is fine?

 

I'm locally developing a site to test with Intersect using Django and Python! Until then everything was fine. Today I uploaded a server to amazon and ended up facing the same err 426. I'm hosting the site on a Digital ocean server that I already have, but when trying to configure the Nginx reverse proxy with an SSL certificate I ended up having some errors, could you evaluate the process and tell me what I can do better?

 

First I configured my api as follows:

...
    "http://0.0.0.0:5400"
  ],
...

...
  "Enabled": true,
  "DebugMode": false,
  "AllowedNetworkTypes": 4,
...

 

So I installed nginx on the server and created a default at: "/etc/nginx/sites-enabled" with the following code:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        server_name myip.mygamedomain.com;

        location / {
                proxy_pass http://127.0.0.1:5400;
        }
}

This url: myip.mygamedomain.com was a subdomain pointing to an EC2 amazon public IPv4 dns linked to an elastic IP to my server instance.

I restarted nginx services and evertything was allright but got problems with certbot...

Could you tell me how could I fix this @jcsnider?

 

Thanks!

Link to comment
Share on other sites

  • 0
2 hours ago, XFallSeane said:

Hi ! You need listen port 443 for https with good certificat (see Let's Encrypt.)
You can use Nginx Proxy Manager if you use docker for simplify everything !

 

Hi @XFallSeane, thank you but I still needing some help lol! I'd already listen port in amazon firewall for 443 https.

 

I created a new EC2 instance, installed docker and docker compose and created a container with ngino proxy manager with this settings:

Spoiler
version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    name: nginx-proxymanager
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    networks:
      - proxy_manager

networks:
      - proxy_manager:
        - name: proxy_manager

 

Then I added a zone with subdomain to my elastic IP addressed to my EC2 instance.

Everything seems working fine until this point. I could login to game.mydomain.com.br:81 to access Nginx Proxy Manager!

I generated a ssl certificate for this subdomain and added a proxy host with this configs:

 

Spoiler

The domain names in Edit Proxy Host and SSL certificate is the same!

4d04586c21b6ddd0467791ad0c2c1eee.png93d8c11fef6bc19e7a7e0ea03b554fb6.png

 

Ah and in amazon firewall rules added 5400 TCP and UDP to all hosts.

 

But when I try https://game.mydomain.com.br:5400/api/oauth/token got error...

What I'm doing wrong?

Link to comment
Share on other sites

  • 0
On 5/7/2023 at 6:44 AM, XFallSeane said:

Keep "http" option in details. 

And once it's done just going to : mygamedomain.com/apiroute

 

:5400 is not necessary after

 

Port 80 443, need to be open too

Thanks @XFallSeane, got a lot of problems to understand the use of Nginx Proxy Manager but could make work with the basic reverse path of nginx installed on the machine!  

Link to comment
Share on other sites

  • 0
21 hours ago, goulcode said:

Thanks @XFallSeane, got a lot of problems to understand the use of Nginx Proxy Manager but could make work with the basic reverse path of nginx installed on the machine!  


i have got lot of problems too but my project for live tv channels is on route with this nginx proxy manager and self server ^^

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...