Build libraries of libwebsockets 3.1 with Visual Studio 2010 on 64-bit Windows 7 (3)

本文介绍如何使用libwebsockets3.1库搭建WebSocket服务器,包括配置步骤及运行示例。提供了默认端口7681的访问方式,并演示了如何通过命令行参数更改端口及启用TLS加密。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    When the libraries of libwebsockets 3.1 are built, some demo programs are built all together. They are shown as below:

    The purpose of 'libwebsockets-test-server.exe' is to run a Websocket server. How to execute it is introduced as follows:
1. Create the sub-folder 'libwebsockets' below the folder ' C:\Program Files (x86) '.
2. Copy the sub-folder ' C:\Temp\libwebsokets\libwebsockets\build\bin\share' to the path ' C:\Program Files (x86)\libwebsockets '.

 

3. Run the executable file: 'C:\Temp\libwebsokets\libwebsockets\build\bin\Release\libwebsockets-test-server.exe ' .
4. Open the Chrome browser, and visit the website: http://127.0.0.1:7681. The webpage is like the following:

 

 

    The default port is 7681. You can assign another port such as 7511 by using the instruction:
libwebsockets-test-server --port=7511
    You can start a Websocket server over TLS by using '--ssl' argument, such as:
libwebsockets-test-server --port=7681 --ssl

    The SSL/TLS configuration of the current IE 11 browser is:

 

    Open the IE browser, and visit the website https://127.0.0.1:7681. The webpage is like the following:

 

    Continue browsing, the webpage is:

    The website https://127.0.0.1:7681 cannot be opened by Chrome browser even if the configuration item 'TLS 1.3 downgrade hardening ' is set to 'Disabled' in page ' chrome://flags/'. The reason is unknown.

1. Compilation 1.1 Windows A workspace for MS Visual Studio is provided with the name "hpm_vsXXXX.sln" in the directory "build\x86_windows". It contains the encoder and decoder projects. 1.2 Unix/Linux Makefiles are provided in the directory "build\x86_linux". 'make' command will create the obj files and generate the executable file in the 'bin' directory. 1.3 CMake for HPM Example for Windows: mkdir build_cmake cd build_cmake cmake .. -G open "HPM.sln" in build_cmake directory to generate the executable files to "build_cmake/app/Debug" or "build_cmake/app/Release" directory. Example for Linux: mkdir build_cmake cd build_cmake cmake .. make -j 'make' command will generate the executable file to the 'build_cmake/app' directory. ******************************************************************* 2. Command line parameters 2.1 Encoder encoder_app [--config file] [-paramShort ParameterValue] [--paramLong ParameterValue] --config file All Parameters are initially taken from the 'file', typically: "encode_RA.cfg". -paramShort ParameterValue --paramLong ParameterValue If -paramShort or --paramLong parameters are present, then the ParameterValue will override the default settings in the configuration file. 2.2 Decoder decoder_app [-paramShort ParameterValue] [--paramLong ParameterValue] All decoding parameters are set by the command lines. ******************************************************************* 3. Examples of command line For SDR, using cfg\encode_RA.cfg For PG, using cfg\HDR\encode_RA_PG.cfg For HLG, using cfg\HDR\encode_RA_HLG.cfg 3.1 Random Access build\x86_windows\x64\Release\encoder_app --config cfg\encode_RA.cfg -i City_1280x720_60.yuv -w 1280 -h 720 -z 60 -p 64 -f 9 -d 8 -q 45 -o City_RA.bin -r City_RA_rec.yuv build\x86_windows\x64\Release\decoder_app -s -i City_RA.bin -o City_RA_dec.yuv 3.2 All Intra build\x86_windows\x64\Release\encoder_app --config cfg\encode_AI.cfg -i City_1280x720_60.yuv -w 1280 -h 720 -z 60 -f 9 -d 8 -q 45 -o City_AI.bin -r City_AI_rec.yuv build\x86_windows\x64\Release\decoder_app -s -i City_AI.bin -o City_AI_dec.yuv 3.3 Low Delay build\x86_windows\x64\Release\encoder_app --config cfg\encode_LD.cfg -i City_1280x720_60.yuv -w 1280 -h 720 -z 60 -f 9 -d 8 -q 45 -o City_LD.bin -r City_LD_rec.yuv build\x86_windows\x64\Release\decoder_app -s -i City_LD.bin -o City_LD_dec.yuv ******************************************************************* 4. Configuration files The default configuration files are provided in the directory "cfg". These contain explanatory comments for each parameter. If the parameter name is undefined, the program will be terminated with an error message. *******************************************************************
最新发布
07-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值