In a different thread under Web I asked for help with site rejections using standalone Xojo web apps. I am not 100% sure but I am pretty confident that this is the result of tightly locked down firewalls rejecting the outgoing requests to non standard ports. I think now that my best option at this point is to use Xojo Cloud for deployment as I don’t see any way that a cgi deployment is going to work for us.
Before I go down this road could someome confirm that what I am planning to do is on track.
With the standalone setup I have 2, soon to be 3, Xojo Web Apps. The only requirement is that the initial log in must come through our home web site which is being served by a 4Th Dimension Database Web Server (Apache is disabled). The requests flow looks something like this…
2 Xojo web apps deployed as standalone web apps named:
JudgesRegistration (listening on port 8080)
DistrictRegistration (listening on port 8008)
User Browser: http://myrequiredsiteurl.com/sef_judgesregistration
or http://myrequiredsiteurl.com/sef_districtregistration
4D Web Server: Case URL = sef_judgesregistration then HTTPRedirect(http://myrequiredsiteurl.com:8080)
Case URl = sef_jdistrictregistration then HTTPRedirect(http://myrequiredsiteurl.com:8008)
Xojo Web App: request for data sent to 4D Database:
data = socket1.Get("http://myrequiredsiteurl.com/getData?regID=5555", 30) (or a post)
Currently, this all works really well except for a small percenage of our users inside of tightly locked down firewalls.
Ok, if I change deplyment to use Xojo Cloud, is this what I can expect the flow to then look like…
I deploy 2 Xojo final web apps to the xojo cloud named:
JudgesRegistration
DistrictRegistration
User Browser: http://myrequiredsiteurl.com/sef_judgesregistration
or http://myrequiredsiteurl.com/sef_districtregistration
4D Web Server: Case URL = sef_judgesregistration then HTTPRedirect(http://myAssignedxojoCloudIP.xojo.com/JudgesRegistration)
Case URl = sef_jdistrictregistration then HTTPRedirect(http://myAssignedxojoCloudIP.xojo.com/DistrictRegistration)
Xojo Web App: request for data sent to 4D Database:
Dim fwp As New XojoCloud.FirewallPort(587, XojoCloud.FirewallPort.Direction.Outgoing)
fwp.Open() ' This call is synchronous
If fwp.isOpen() Then
data = socket1.Get("http://myrequiredsiteurl.com/getData?regID=5555", 30) (or a post)
fwp.Close() ' Close port when done
End If
Am I going down the right road here? Any reason to believe that after deploying to the cloud, I might continue to have issues similar to the rejections we are experiencing at the moment with the standalone web apps?
Thanks,
John
I believe they will be running in CGI mode on Xojo Cloud. CGI does solve your port issues. You could also use a load balancer in front of the standalone apps and achieve the same effect.
I am not familiar with a “load balancer”. I did a google search and, correct me if I am wrong, but at this point it looks like it might be much easier to use Xojo cloud. I see a greater learning curve for me with trying to implement a load balancer.
Ok. I came to the realization that because of the way I am uploading and downloading PDF files between the database and teh web apps, the database web server and the web apps have to be on the same machine. If I go the cloud route, I am pretty sure I would have to rethink and rewrite this process. I realy do not want to fix what is not broken.
Load Balancing?? Where do I go to find out what I need and how to implement it on an OS X server? Google searches are not helping much in this reagard.
Maybe I should ask this question elsewhere in the forum?
http://john-joyce.com/xojo-and-load-balancing-with-haproxy/
I followed that guide to get HA-Proxy running in front of 5 instances of my standalone app on Linux, works great!
Edit: I see you’re on OSX. Should be able to follow that guide anyway to configure HAProxy for OSX.
Based on what you’ve written, I don’t think you’re going to have trouble on Xojo Cloud. Also, remember, you can try it out for a month.
Looking at your code, your firewall code is a little “off”. You are opening port 587 (which is for sending email) to do an http request (which is on port 80). You don’t need to open a firewall port for port 80 or 443 on Xojo Cloud. I’d also suggest using https for that request if it contains user identifying data.
That said, I don’t see anything from what you have described that wouldn’t work on Xojo Cloud.
@Greg O’Lone
Thanks Greg. Maybe I am seeing a problem that is not there. The web app provides the end user a way to download and up load forms in pdf format that require signatrues. I am using the local file system to facilitate this process, which if I deploy using Xojo Cloud I think I am going to have to completely rethink and rewrite the process…
Download…
- Xojo Web App sends request to 4D Database for the form
- 4D creates a pdf file of the form and returns the full file path to the pdf file
- Xojo Web App opens the file in an HTMLViewer
Upload…
- Xojo Web App has user upload a pdf file using a FileUploader Control
- The FileUploader saves the pdf to a file in an “upload folder” on the hard disk.
- The FileUploader then sends a request to 4D to handle the uploaded file
- 4D does it’s thing with the file, logging the event, and in some cases moving the file to a different folder
- The FileUploader on reciept of “success” from 4D downloads the just uploaded pdf using the download process above to provide feedback to the end user of a successful upload.
I am sure there are other ways I could or should have done this, but that is the way I did it and it works well. The probem I am perceiving is that if I deploy the web app to Xojo Cloud, I will have to rewrite this process as the web app and 4D will no longer be on the same machine.
At the present time I am not sure that I want to go down the path of fixing something that is not broken. I have too many other things to work on. The problem firewalls are at school district offices and I am hoping to get their IT staffs to open up port 8080 so that I can put this issue off until I have more time to tackle it.
If you see an easy route for me to take here, please let me know.
John
@Greg O’Lone You are opening port 587 (which is for sending email) to do an http request (which is on port 80). You don’t need to open a firewall port for port 80 or 443 on Xojo Cloud.
Yes I see that now. I copied that from the overview of Xojo Cloud deployment and did not pay attention to the port number. That being said, the overview says…
Is this not the case? I am communicating outside the server with my 4D database using socket classes.
Not if you’re communicating on port 80 or 443.