foxpages

2025-12-10 0 133

Fox Pages Server 3.5.1

Português

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.ex*a*mp*le.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://lo*cal*host*, https://lo*ca*lhost)*.

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 cliente@teste.com.br and the password 123456.

The representative account starts an application for customer and order registration. To access use the email representante@teste.com.br 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-p*lat*f*orm.com or by this direct link: http://demo.boa-pl*atform.c**om. When the login screen appears, you can use the following:

User: en

Password: en01

URL of API server: http://loca*l*h*ost/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://so*ck*ettool*s.com/release-notes/)

v3.1 – Release 2018.06.26

  • Security update. SocketWrench Control updated to version 9.3 (Release Notes at https://so*ck*ettool*s.com/release-notes/)

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.

下载源码

通过命令行克隆项目:

git clone https://github.com/arquimedescrivelari/foxpages.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 编程相关 foxpages https://www.zuozi.net/33490.html

Music Player
上一篇: Music Player
d2l en
下一篇: d2l en
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务