Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG]AGK (tier 1) App on Windows won't connect to AWS backend

Author
Message
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 10th May 2017 21:07 Edited at: 10th May 2017 21:37
Been making this frontend to administer a backend (written in Golang using a RESTful API over http) that resides on an AWS ec2 instance. Doing it using AGK2 2017.02.28 tier 1 on Linux, and it all went swimmingly. No problems. Would behave as expected running on Linux and when exported to APK.

Then booted into Win10 just to compile out a windows version using the newest AGK2 version (2017.04.24) - and my app would not connect to the backend. My error-handling code reports "No Connection to Server!".

So went on an uninstall/install spree of AGK2 on Windows 10. Same thing, no connection to server when running my App under windows - regardless of compiling using 2017.02.28, 2017.04.11 or 2017.04.24. For lolz and giggles, I went back to linux, installed the newest version there, compiled and again working as intended. Hell, even tried on an old mac running 2017.04.11, and it works there too. So something in the Windows implementation of AGK2 is fishy.

AWS ec2 adresses are quite long and convoluted, typically something like 'ec2-222-222-222-222.eu-central-1.compute.amazonaws.com:8080'

My AppGameKit code for connecting to it:



(the ip.adressAT variable holds the URL + port string)

Also, it is not some hokus-pokus with firewall on windows. Tested with fw on and off, no dice.

When I get to the office tomorrow, I'll set up a DNS to get a more managable URL for the backend, and see if that makes any difference for poor old AGK2 for Windows.

Hitting the URL request to the backend directly in firefox yields the expected (and correct) response. Works fine there. Do the http handler in the Windows version of AGK2 have some kind of URL string length restriction?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th May 2017 00:43
Can you use wireshark and verify the outgoing connection is correct (and is actually being sent)?

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 11th May 2017 09:20
Quote: "Can you use wireshark and verify the outgoing connection is correct (and is actually being sent)?"


It is - the request seem to stop at AMAZO-ZFRA (35.156.75.109) Which I am guessing is the Amazon datacenter in Frankfurt - where my server resides.

from start to finish:

5 2.058741 192.168.1.101 35.156.75.109 TCP 66 49852 → 80 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=8 SACK_PERM=1
!!6 2.104229 35.156.75.109 192.168.1.101 TCP 60 80 → 49852 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
7 2.183341 192.168.1.144 239.255.255.250 SSDP 318 NOTIFY * HTTP/1.1
*8 2.604402 192.168.1.101 35.156.75.109 TCP 66 [TCP Spurious Retransmission] 49852 → 80 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=8 SACK_PERM=1
!9 2.650067 35.156.75.109 192.168.1.101 TCP 60 80 → 49852 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
*10 3.150449 192.168.1.101 35.156.75.109 TCP 66 [TCP Spurious Retransmission] 49852 → 80 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=8 SACK_PERM=1
!!11 3.196146 35.156.75.109 192.168.1.101 TCP 60 80 → 49852 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
12 3.548142 Cisco_f2:51:3d Spanning-tree-(for-bridges)_00 STP 60 Conf. Root = 32768/0/00:a2:ee:f2:51:3c Cost = 0 Port = 0x8001
13 5.548219 Cisco_f2:51:3d Spanning-tree-(for-bridges)_00 STP 60 Conf. Root = 32768/0/00:a2:ee:f2:51:3c Cost = 0 Port = 0x8001
14 7.172199 192.168.1.144 239.255.255.250 SSDP 318 NOTIFY * HTTP/1.1
15 7.195934 192.168.1.101 35.156.75.109 TCP 66 49853 → 80 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=8 SACK_PERM=1
!!16 7.241492 35.156.75.109 192.168.1.101 TCP 60 80 → 49853 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
17 7.548259 Cisco_f2:51:3d Spanning-tree-(for-bridges)_00 STP 60 Conf. Root = 32768/0/00:a2:ee:f2:51:3c Cost = 0 Port = 0x8001
*18 7.741722 192.168.1.101 35.156.75.109 TCP 66 [TCP Spurious Retransmission] 49853 → 80 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=8 SACK_PERM=1
!!19 7.787291 35.156.75.109 192.168.1.101 TCP 60 80 → 49853 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
20 7.826769 192.168.1.101 54.192.130.51 TCP 55 49744 → 80 [ACK] Seq=1 Ack=1 Win=254 Len=1
21 7.869889 54.192.130.51 192.168.1.101 TCP 66 80 → 49744 [ACK] Seq=1 Ack=2 Win=156 Len=0 SLE=1 SRE=2
*22 8.288660 192.168.1.101 35.156.75.109 TCP 66 [TCP Spurious Retransmission] 49853 → 80 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=8 SACK_PERM=1
23 8.334422 35.156.75.109 192.168.1.101 TCP 60 80 → 49853 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0


!! = line in red
* = line in black

So something is going out where it should - and getting back, but the AGK2 app on windows won't pick it up. Unlike if the app is compiled and running on linux, mac or android.





Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 11th May 2017 11:53
https://www.appgamekit.com/documentation/Reference/HTTP/SetHTTPHost.htm

Quote: " Note that trying to use a specific port with www.thegamecreators.com:8080 may be ignored on some platforms and port 80 will be used in these cases.
"


In your log it is using port 80 , so you need to open port 80 on your AWS ec2

best regards Preben Eriksen,
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 11th May 2017 12:15 Edited at: 11th May 2017 12:18
The app is set to give the request to the backend on port 8001 in a URL string like this:

ec2-222-222-222-222.eu-central-1.compute.amazonaws.com:8001

(ip numbers changed obviously)

http requests from client will use port 80 and the return payload will be delivered on port 80, as that (and the backup 8080) are defaults for handling http traffic.

On the AWS instance, only port 23 (ssh), 8000 (backend service 1) and 8001 (backend service 2) are open. I'll give it a whirl and open port 80 for tcp on the server (and make the server app listen on it) and report back
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 11th May 2017 15:50
Ahh that make sense when Paul write that :8001 will not be used on all platforms , so backend will sent to a default port ? , what port is used if you do not specify :8001 in the url ? that should be it
best regards Preben Eriksen,

Login to post a reply

Server time is: 2024-11-24 13:24:19
Your offset time is: 2024-11-24 13:24:19