All Projects → arquimedescrivelari → foxpages

arquimedescrivelari / foxpages

Licence: MIT license
Visual FoxPro Multithread Web Server

Programming Languages

xBase
55 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language
CSS
56736 projects
c
50402 projects - #5 most used programming language
Batchfile
5799 projects

Projects that are alternatives of or similar to foxpages

Dbutils
Database connections for multi-threaded environments
Stars: ✭ 212 (+863.64%)
Mutual labels:  multi-threading
mu-server
A lightweight modern webserver for Java
Stars: ✭ 31 (+40.91%)
Mutual labels:  webserver
asws
Another static web server, plus JSON REST API for exposing specified directory listings. Useful for download pages or listings asset for web applications.
Stars: ✭ 21 (-4.55%)
Mutual labels:  webserver
Aff3ct
A fast simulator and a library dedicated to the channel coding.
Stars: ✭ 240 (+990.91%)
Mutual labels:  multi-threading
bmcweb
A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Stars: ✭ 109 (+395.45%)
Mutual labels:  webserver
anyfesto
Low cost Raspberry Pi /Linux based access point with audio, education and communications local content server. Inspired by the ideas of sharing with others. Anyfesto - a platform from which to speak.
Stars: ✭ 66 (+200%)
Mutual labels:  webserver
Zhihuspider
多线程知乎用户爬虫,基于python3
Stars: ✭ 201 (+813.64%)
Mutual labels:  multi-threading
mf-chsdi3
api3.geo.admin.ch source code.
Stars: ✭ 35 (+59.09%)
Mutual labels:  webserver
Crow
A Fast and Easy to use microframework for the web.
Stars: ✭ 1,718 (+7709.09%)
Mutual labels:  webserver
Kvantum
An intellectual (HTTP/HTTPS) web server with support for server side templating (Crush, Apache Velocity and JTwig)
Stars: ✭ 17 (-22.73%)
Mutual labels:  webserver
Knock
🔑 Scan the entire internet for SSH and Telnet services. Then hack them.
Stars: ✭ 60 (+172.73%)
Mutual labels:  internet
MiServer
MiServer- an APL-based web server - requires Dyalog APL available from http://www.dyalog.com
Stars: ✭ 43 (+95.45%)
Mutual labels:  webserver
ez-net-app
EZ Net is an application developed for rural internet users which are not tech savy and shows interest in the internet and the resources it has.
Stars: ✭ 16 (-27.27%)
Mutual labels:  internet
File Commander
Cross-platform Total Commander-like orthodox file manager for Windows, Mac and Linux
Stars: ✭ 216 (+881.82%)
Mutual labels:  multi-threading
Android-Firewall
Basic netguard app from playstore ,reduced to its minimum level for vpn and firewall logic
Stars: ✭ 41 (+86.36%)
Mutual labels:  internet
Leaf
Lightweight Error Augmentation Framework
Stars: ✭ 201 (+813.64%)
Mutual labels:  multi-threading
Windows-to-Android-Internet-with-USB-Cable-Reverse-tethering-setup-for-Windows
One click windows to android internet connection (Opposite of Android USB Tethering)
Stars: ✭ 34 (+54.55%)
Mutual labels:  internet
webfr
moved to: https://github.com/godzillaframework/godzilla.git
Stars: ✭ 13 (-40.91%)
Mutual labels:  webserver
direct-net-share
share internet via Wifi direct on Android
Stars: ✭ 36 (+63.64%)
Mutual labels:  internet
super-workers
🐴 Distribute load on front-end via parallelism
Stars: ✭ 93 (+322.73%)
Mutual labels:  multi-threading

Fox Pages Server 3.5.1

PTBR
Português

ZNCH
Chinese

What is this?

Fox Pages Server (FPS) is a multithreaded HTTP, HTTPS, and FastCGI server for Visual FoxPro.

With Fox Pages Server you can develop, debug, and distribute web content and applications by using Visual FoxPro.

Fox Pages Server does not allow Visual FoxPro code to run on the Internet. This is why it is necessary to know the language and development tools for internet that will be used, for example: HTML, CSS, Javascript, JQuery, Dojo etc.

Fox Pages Server can be used in combination with the boa-platform. This way you can create Web applications without any knowledge of a web development language. Fox Pages Server communicates with BOA.

Requirements

Microsoft Visual FoxPro 9.0

Distribution

Fox Pages Server is distributed in two modes: development mode and distribution mode.

Development Mode

In this mode, the server works by default in singlethread, so that it is possible to use Visual FoxPro for the development of FXP pages. The development mode requires Visual FoxPro installed.

Distribution mode

In this mode, the server works in multithread, providing extreme processing gain. The distribution mode requires the Visual FoxPro runtime installed.

In development and distribution modes, any error is recorded in tables in the LOGS folder allowing detection and tracing of errors.

Before installing

Do not attempt to do the installation procedure in development and deployment mode on the same computer. If this is necessary, run the install.bat file from distribution mode, because it will register the components will also create the Windows Service. Configure the development mode to use an IP or port other than the distribution mode.

Installation in development mode

  1. Locate the Development folder.
  2. Run the install.bat file. (To install on Windows 10 run using Command prompt as administrator)
  3. Run the desired protocol program, located in the SERVERS folders, HTTP.FXP is the default.

The Visual FoxPro debugging will only work in development mode because it is impossible to display any interface when the code runs in a multithreaded DLL. Any attempt will generate errors or freeze the thread.

Installation in distribution mode

  1. Locate the Distribution folder.
  2. Run the install.bat file. (To install on Windows 10 run using Command prompt as administrator)

Security Tip

It is not recommended to leave the .HTML files with their .FXP compiled in the same folder of the server, they can be downloaded if the extension is changed in the webbrowser.

Before starting

Fox Pages uses port 80 as default for HTTP, so before starting it is necessary to stop any service that is using port 80 (IIS, Apache, etc.) or change the port used in the HTTP.PRG program located in the SERVERS folder on the mode, or in the PORT field of the SERVERS.DBF table located in the DATA folder in distribution mode.

Other protocols follow the same procedure.

Setting up HTTP and HTTPS servers

The FPS.DBC database located in the DATA folder stores the configuration of the servers. The documentation of the tables and their respective fields can be found in the FPS.HTML file. The relationship between the tables can be viewed in the FPS.JPG image.

Servers

The servers are responsible for the connections of the clients (IE, Chrome, Firefox, etc) and servers (NGinX, etc).

Each server runs on a separate thread and can, depending on the configuration of the IP number, listen on the same port. In case of conflicts of IP numbers and ports the first configured server will receive the connections.

Configure the servers by adding, modifying, or deleting records in the SERVERS.DBF table.

Each protocol defaults to a specific port:

  • HTTP must be configured for port 80.
  • HTTPS must be configured for port 443.

FastCGI is usually used in communication between servers, there is no default port.

Sites

Sites establish a relationship between a HOSTNAME (e.g. www.example.com) with the folder where the site files are located (e.g. c:\sites\example), and configures your home page (e.g. index.fxp, index. php, index.html, etc).

Configure the sites by adding, modifying, or deleting records in the SITES.DBF table.

If the HOSTNAME field is filled with "*" all HOSTNAMES will be related to the same folder.

In this same table we configure redirects by filling in the REDIRECT field with the full address of the redirection. This feature is very useful when we need to, for example, redirect unsecured connections (HTTP) to a secure server (HTTPS), this is done for example by filling in the REDIRECT field of the site www.example.com from the unsafe server (HTTP) with "https://www.example.com", the secure site address (HTTPS).

Gateways

Gateways are used to send requests to other development tools. PHP has been the only one tested so far, while any tool that supports FastCGI must be compatible.

Configure the gateways by adding, modifying, or deleting records in the GATEWAYS.DBF table.

The only protocol supported is FastCGI.

Gateways work in a similar way to Sites, establishing a relationship between a HOSTNAME (e.g. www.example.com) with the folder where the site files are located (e.g. c:\sites\example). The difference lies in the fact that the contents of the URI field (e.g. ".php") must be contained in the request URI so that it is sent to the gateway.

Based on these criteria, Fox Pages Server transforms the HTTP request into a FastCGI request and sends it to the configured server. The FastCGI response is then transformed into an HTTP response and sent to the client.

Requests that do not meet the criteria will be processed by the HTTP server, so for each Gateway a Site must be configured.

Security

Not all folders and files contained within a site must be accessible. Databases, tables, and programs are some examples.

Fox Pages Server has the access control system that allows authorized access or complete blocking of site folders.

Access control is configured by adding, modifying, or deleting records from tables REALMS.DBF, USERS.DBF, and REALMUSER.DBF

The REALM.DBF table sets the access settings for the site folders.

The USERS.DBF table defines the users who will have access to the folders.

The REALMUSER.DBF table lists users with folders.

CORS (Cross-Origin Resource Sharing)

It is a browser mechanism that prevents an origin (domain) from accessing resources in a distinct source (another domain) without authorization.

Configure authorizations by adding, modifying, or deleting records in the CORS.DBF table.

Enter the site that will grant authorization in the SITE field. This field is related to the SITES.DBF table.

Enter the origin (authorized domain) in the ORIGIN field, if it is filled with "*" any origin will be allowed.

Enter the resource in the URI field, if it is filled with "*" any refuse will be allowed.

The GET, POST, PUT, DELETE, HEAD, and OPTIONS fields determine what methods are allowed.

The HEADER field must be populated with the allowed HTTP headers. They should be delimited with a comma followed by a space.

Setting up FastCGI servers

Fox Pages Server can be configured to be used through other web servers using the FastCGI protocol.

The nginx.conf file located in the NGINX folder is a configuration template for the NGinX server. Copy this file to the CONF folder where NGinX is installed and configure the ROOT parameter with the full path of the site files folder.

To configure Fox Pages Server to use the FastCGI protocol, fill the TYPE field of the SERVERS.DBF table with "FCGI".

As all information required for the processing of the request must be provided by the web server, there is no need to configure sites, gateways or security.

Accessing the first time

After server startup use any browser by typing in the configured server address (e.g. http://localhost, https://localhost).

Demo site

To enter the demo site there are two accounts, one for the client and one for the representative.

The customer's account access the customer area. To access, use the email [email protected] and the password 123456.

The representative account starts an application for customer and order registration. To access use the email [email protected] and the password 123456.

Dynamic pages

A dynamic page uses a server-side programming language in the development of a website or Internet application.

The Fox Server Pages makes it possible to develop these pages using the resources of static pages of developments (eg HTML, CSS, Javascript) with Visual Fox Pro programming features (eg console language programming, database).

In Fox Pages Server an HTML page is converted into a PRG program file and compiled into a compiled FXP file, so page processing is extremely fast and does not have the limitations of using another interpreter.

In the compilation process only the code between the <FPS> and </FPS> tags will be processed, the rest will be sent as static content.

An example of static content.

<HTML>
Hello World
</HTML>

Result:

Hello World

An example of a program as static content because of the missing <FPS> and </FPS> tags.

<HTML>
for nCounter = 1 to 3
    Hello World
next
</HTML>

Result:

for lnCounter = 1 to 3
    Hello World
next

An example using the tags <t> and <e>, they are responsible for sending static texts and expressions.

<HTML>
    <FPS>
       cWorld = "World"
       for nCounter = 1 to 3
          <t>Hello </t><e>cWorld</e><br>
       next
    </FPS>
</HTML>

Result:

Hello World
Hello World
Hello World

An example using other HTML tags combined programming. Every line started with an HTML tag or by the <t> tag is sent.

<HTML>
    <FPS>
       <b>Begin</b><br><br>

       cWorld = "World"
       for nCounter = 1 to 3
          <b><t>Hello </t><e>cWorld</e></b><br>
       next

       <br>
       <t>End</t>
    </FPS>
</HTML>

Result:

Begin

Hello World
Hello World
Hello World

End

RESTfull Applications

REST (Representational State Transfer) is an architectural style that advocates that Web applications should use HTTP as originally intended, where GET, PUT, POST and DELETE requests should be used for query, change, creation, and deletion, respectively.

Fox Pages Server processes a request as REST whenever the Accept header is "application/json" or "application/xml".

More details can be found in the application available on the demo site when signing in with the representative account.

BOA Platform

With Fox Pages Server you can build a REST API to serve the requests of the BOA platform. You can create a complete web application in Visual Foxpro. Fox Server Pages will respond to the requests that are send by BOA. The data that is send between Fox Server Pages and BOA are easy to understand JSON strings.

After setting up your Visual Fox pages, you can test the power of this combination. Start the demo on https://www.BOA-platform.com or by this direct link: http://demo.boa-platform.com. When the login screen appears, you can use the following:

User: en

Password: en01

URL of API server: http://localhost/boa. This is your local Fox Pages Server.

See the demo/boa folder for the sample source code.

Incompatibility with version 2.0

For FastCGI protocol support, the processing of Request and Response object properties has been changed.

In version 2.0 headers with hyphens (e.g. Accept-Encoding) had the hyphen removed (e.g. AcceptEnconding). In version 3.0 these hyphens are changed to underline (e.g. Accept_Encoding).

Licensing

Fox Pages Server is free and open source software. The license is located in the LICENSE file.

The component used for the connections is the Socketwrench of the company Catalyst Development Corporation (www.sockettools.com).

This component is distributed in the free and commercial versions. The free version does not support secure connections (SSL/TLS).

The development version of Fox Pages Server is configured to use the free version of SocketWrench. This will be a limitation only if the use of secure connections in the development environment is required.

To use the commercial version of SocketWrench you must purchase a license, as Fox Pages Server does not include this license.

The version configuration used, free or commercial, or the version of SocketWrench, is located in the FOXPAGES.H file of the CORE folder, as follows:

//SOCKETWRENCH
#DEFINE USEFREEVERSION
#DEFINE CSWSOCK_CONTROL "SocketTools.SocketWrench.6"

//SocketWrench 8
//#DEFINE CSWSOCK_CONTROL "SocketTools.SocketWrench.8"
//#DEFINE CSWSOCK_LICENSE_KEY "INSERT YOUR RUNTIME LICENSE HERE"

//SocketWrench 9
//#DEFINE CSWSOCK_CONTROL "SocketTools.SocketWrench.9"
//#DEFINE CSWSOCK_LICENSE_KEY "INSERT YOUR RUNTIME LICENSE HERE"

You need to recompile the project after you change these settings.

What's New?

v3.5.1 - Release 2019.09.22

  • Fix compression issues

v3.5 - Release 2019.09.02

  • BOA platform support
  • Cross-Origin Resource Sharing (CORS) support
  • Correction of data read error with secure connections
  • Some renamed classes and property
  • Security update. SocketWrench control updated to version 9.5 (Release Notes at https://sockettools.com/release-notes/)

v3.1 - Release 2018.06.26

Credits

Multithreading - VFP2C32T.FLL - Christian Ehlscheid
Compression - VFPCompression - Craig Boyd
Encryption - VFPEncryption - Craig Boyd
JSON Parser - Modified library version - Craig Boyd
Sockets - Socketwrench - Catalyst Development

Donate

If this project is usefull to you, consider a donation.

paypal

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].