-
How is the new API system working? I can connect to my API using Postman, but when using an internal site to access the API, I get a connection error, it cannot find it I followed all the API docs and references. I can connect, get the key, check online players, give items, etc., using Postman. However, when trying to use a CMS or any method using CURL, it doesn't work. Is there something missing that I need to configure? I already set up reverse proxy and, as I said, it works normally through Postman.
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 10 replies
-
When accessing the api externally there must be a whole configuration to have https running normally as this is the only way to allow access to the api, that being said I know that the AllowedNetworkType should be 4, and perhaps some other extra configuration as a reference I follow this it works well to connect to the intersect hosting, so it should work for you if you really have everything configured correctly (especially the reverse proxy part) |
Beta Was this translation helpful? Give feedback.
-
i am accessing it via the link: https://api.rebornia.com.br/ Using the JSON correctly, POST Method, json
|
Beta Was this translation helpful? Give feedback.
-
I tested here and received error 426 (https required) and not 405, so some change has already happened |
Beta Was this translation helpful? Give feedback.
-
okay, now i get the 405, so now it should probably be ok for the api to work, try to get your api token with api username and password and everything should be ok |
Beta Was this translation helpful? Give feedback.
-
The 'AllowedNetworkTypes' field controls which ip address ranges are even allowed to connect if I recall correctly. 1 means that only localhost can communicate. 2/3 are something in the middle. Unless you use a reverse proxy I do not think that you will be able to get remote api access working over the internet without code changes. Furthermore I have never seen the certificate fields actually used and working with the kestrel properties. Not sure if it works or not. My recommendation:
There is a really nice docker called NginxProxyManager which I use and personally like which can make this even easier. Keep in mind that Nginx has a site setup with https and a certificate. The game server has mostly default settings. Make these changes but for KnownProxies use the IP address where your reverse proxy connects from (ie 127.0.0.1 or 192.X.X.X) |
Beta Was this translation helpful? Give feedback.
-
Thank you all very much for the attention on this topic, but I managed to solve the problem, and I am posting here how I made it work, in case it is useful for someone. Special thanks to @adiif1 @XFallSeane for discord support I defined my Ubuntu iptables as follows:
In Nginx
And with that, everything works now. |
Beta Was this translation helpful? Give feedback.
Thank you all very much for the attention on this topic, but I managed to solve the problem, and I am posting here how I made it work, in case it is useful for someone.
Special thanks to @adiif1 @XFallSeane for discord support
I defined my Ubuntu iptables as follows:
"KnownProxies": ["127.0.0.1","MY EXTERNAL IP"],
In Nginx
And with that, everything works now.