Learn to Use Powerful SGC WebSockets WebRTC in C++ Builder
Do you want to learn what is Websockets? What is WebRTC? How can we Install and use SGC Websockets WebRTC? Can we use web sockets compatible with HTTP proxies? How do I find easy to use WebRTC components for C++ Builder? Present post answers these questions as below. We have other articles on the blog showing some of the many uses of the Websocket protocol – you can find them by clicking here. What are WebSockets? WebSocket is a communications protocol, was standardized by the IETF as RFC 6455 in 2011, and the WebSocket API in Web IDL is being standardized by the W3C. The WebSocket protocol uses a single TCP connection to provide full-duplex communication channels. WebSocket is compatible with HTTP because of being designed to work over HTTP ports 443 and 80 as well as to support HTTP proxies and intermediaries. The WebSocket handshake uses the HTTP Upgrade header[1] to change from the HTTP protocol to the WebSocket protocol, to achieve this compatibility. That means in a Communication with Websockets, the communication begins with an HTTP request, then upgrades to Websockets protocol using the TCP protocol connection for communication. What is WebRTC? WebRTC (Web Real-Time Communication) is a free, open-source WebSockets communication protocol that provides real-time communication (RTC) between web browsers and mobile applications via simple application programming interfaces (APIs). WebRTC allows direct peer-to-peer communication, eliminating the need to install plugins or download native apps with audio and video communications. How to use WebRTC components for C++ Builder? Sergio Gómez, is an individual developer specializing with Embarcadero tools since 1999. In 2012, he started the eSeGeCe website to provide components for Delphi, CBuilder, and .NET developers. Detailed information about WebRTC can be found on their ESEGECE web page here Installation Download sgc WebRTC from their official eSeGeCe web page here 2. Unpack the zipped file to a folder and got to “sgcWebSockets_cbuilder_C10_4Packages” folder 3. There is a dclsgcWebSocketsC10_4.cbproj which is a package that has sgc WebSockets components. If you have RAD Studio 10.4.x double click on it or open it via RAD Studio 4. In Projects windows on the right side, right click to dclsgcWebSocketsC10_4.bpl and select Build, and again select Install as below, Now you can see Tsgc… WebSockets classes in your Palette. In RAD Studio, select Tools->Options menu and then go to Language->C++->Paths and Directories section, Here, be sure that Windows 32-bit is selected and click the ellipsis “…” button at the right side of System Include path and add libC10_4/win32 or libD10_4/win32 folder to these paths. Also, set the Selected Platform to Windows 64-bit and be sure that Windows 64-bit is selected, Click the … button at the right side of System Include path and add libC10_4/win64 or libD10_4/win64 folder to these paths. If you have a problem adding these please watch their official video in there download page here C++ Builder example of how to use WebSockets Create a new VCL C++ Application and save all project files units into a new folder. From Tools palette add 2 buttons (name ‘Connect‘ and ‘Disconnect‘) and Memo1 as an output Add a sgcWebSocketServer, sgcWebSocketClient and sgcWebRTCServer, 4. Double click to Connect and Disconnect buttons to create their OnClick events. You can use F12 to switch form and code display.5. Select sgcWebSocketServer1, in Object Inspector, goto it’s events double click to OnConnect and OnDisconnect events6. Now we can Activate […]
