使用默认的compileserver.exe测试Pas2JS_Widget编译出来的js,浏览器显示为空白。
经排查发现需使用ssl才能正常显示,但compileserver.exe不支持ssl,需要添加ssl支持单元。
处理步骤:
1、修改fpcsrc\utils\pas2js\httpcompiler.pp,添加opensslsockets单元
经排查发现需使用ssl才能正常显示,但compileserver.exe不支持ssl,需要添加ssl支持单元。
处理步骤:
1、修改fpcsrc\utils\pas2js\httpcompiler.pp,添加opensslsockets单元
unit httpcompiler; {$mode objfpc} {$H+} interface uses {$ifdef unix}baseunix,{$endif} {$IF FPC_FULLVERSION > 30300} strutils, {$ENDIF} sysutils, classes, fpjson, contnrs, syncobjs, fpmimetypes, custhttpapp, inifiles, types, fpwebproxy, webutil, fpwebfile, httproute, httpdefs, dirw, Pas2JSFSCompiler,opensslsockets, Pas2JSCompilerCfg, ssockets, fpdebugcapturesvc, fpsimpleserver; Const HTTPCompilerVersion = '1.0'; nErrTooManyThreads = -1; nExitCodeSocketError = 1;
2、重新编译compileserver.pp,并将编译生成的compileserver.exe替换原来的compileserver.exe
\fpc\bin\x86_64-win64\fpc .\compileserver.pp
3、ssl动态库使用libssl-1_1-x64.dll和libcrypto-1_1-x64.dll
4、启用ssl要运行compileserver.exe时添加-s
.\compileserver.exe -s -i poject1.html
设计时的页面:

未启用ssl时显示空白:

启用ssl后显示正常:



浙公网安备 33010602011771号