使用默認的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號