У нас вы можете посмотреть бесплатно How to Identify the Client TCP Port in Delphi 10.4 WebBroker Connections или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Discover effective methods to retrieve the `client TCP port` when using Delphi 10.4 WebBroker with TWebBrowser. Learn about the limitations and alternative suggestions here. --- This video is based on the question https://stackoverflow.com/q/68726044/ asked by the user 'Clint Cronwright' ( https://stackoverflow.com/u/7773207/ ) and on the answer https://stackoverflow.com/a/68729685/ provided by the user 'Remy Lebeau' ( https://stackoverflow.com/u/65863/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions. Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: In Delphi 10.4 how do I provide the client tcp port to a WebBroker (TWebModule) when connecting via a TWebBroswer? Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l... The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license. If anything seems off to you, please feel free to write me at vlogize [AT] gmail [DOT] com. --- Finding the Client TCP Port in Delphi 10.4 WebBroker When developing applications using Delphi, especially those involving web modules and browsers, developers often have specific requirements. One such requirement is the need to determine the TCP port from which a client is connecting. This can be crucial for logging, security, or debugging purposes. In this guide, we will explore a common issue faced by developers: How to obtain the TCP port of a client when using a TWebBrowser with a Delphi WebModule? We will delve into the limitations of the standard tools and provide suggestions for handling this situation effectively. The Problem at Hand You might find yourself in a situation similar to the following: You have a TWebBrowser on the client side and are connecting to an Apache server that is running a Delphi WebModule. The client connects to the server on port 80, the standard web port. However, you need to report back the client’s originating port through the WebModule. Although you can retrieve the client's IP address with Request.RemoteAddr, obtaining the originating port is not straightforward. The Limitation of TWebRequest Unfortunately, TWebRequest, which is part of the WebBroker framework, does not provide an easy way to access the client's port. Here’s why: WebBroker Design: The framework abstracts many low-level details, including socket management. Lack of Port Exposure: TWebRequest does not expose the client's port number or provide access to the underlying request/socket. This limitation is intrinsic to the WebBroker component rather than an issue with the Indy framework, which WebBroker can utilize through its IdHTTPWebBrowserBridge. Indy indeed has access to the client port, yet this capability does not extend to the mechanisms that WebBroker uses internally. What This Means for You Since you can't directly obtain the client port using standard WebBroker tools, you may feel stuck. However, there are alternatives to consider: Suggested Alternatives Use Indy Directly: If you're comfortable with it, consider implementing the TCP communication using Indy directly rather than relying solely on WebBroker. This way, you can access the client’s TCP properties freely. Custom Middleware or Handlers: Create a custom middleware layer that handles socket connections and extracts the necessary properties before processing the request with WebBroker. This could be more complex but will let you access the client port. Client-side Logging: If it's feasible from a design perspective, consider logging the client's originating port from the client application itself and then send it to the server on requests. This method circumvents the limitations of WebBroker completely. Conclusion Understanding the limitations of the Delphi WebBroker when trying to retrieve the client TCP port is essential for developers working in this environment. Despite the challenges, using alternatives such as Indy or implementing custom middleware can lead you to a solution that meets your requirements. While TWebRequest may not be able to expose the client port directly, by exploring these options, you can ensure that your application gathers the necessary information while maintaining robust functionality. Final Thoughts In a world where security and clarity is paramount, knowing how to navigate the limitations of your tools can significantly impact your development process. With this knowledge in hand, you can make more informed decisions on how to structure your Delphi applications.