模拟 Indy 的传入网络消息

发布于 2024-07-18 03:28:27 字数 187 浏览 7 评论 0原文

是否可以使用 Indy 模拟传入消息(如果有任何重要性:我正在使用 Indy 10 和 Delphi 2009)? 我希望能够在本地创建这些消息,并且我希望 Indy 相信它们来自网络中的特定客户端。 所有内部 Indy 处理(选择接收消息的线程等)应该与消息通过网络到达时完全相同。

对此有什么想法吗? 预先感谢您的任何提示。

Is it possible to emulate incoming messages using Indy (if it's of any importance: I'm using Indy 10 and Delphi 2009)? I want to be able to create these messages locally and I want Indy to believe that they come from specific clients in the network. All the internal Indy handling (choice of the thread in which the message is received and stuff like that) should be exactly the same as if the message would have arrived over the network.

Any ideas on that? Thanks in advance for any tips.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

甚是思念 2024-07-25 03:28:27

你想要做的事情与 Indy 无关,因为你需要在一个低得多的级别上做这件事。 让 Indy 相信消息来自特定客户端的最简单方法是将正确准备的数据包注入网络堆栈。 在 Google 或 Wikipedia 上阅读 TCP 数据包注入。 EtterCap 就是这样一种工具,它允许将数据包注入已建立的连接中。 然而,这肯定会进入灰色地带,因为某些工具在某些国家是非法的。

无论如何,恕我直言,所有这一切都太复杂了。 我不知道您到底想做什么,但是专门准备的客户端或服务器是在开发服务器或客户端应用程序时模拟某些行为的更好工具。 您可以在本地运行它们,或者如果您需要不同的 IP 地址或子网,则可以使用虚拟机执行很多操作。

What you want to do has nothing to do with Indy, as you would need to do this on a much lower level. The easiest way to make Indy believe that messages come from a specific client is to inject properly prepared packets into the network stack. Read up on TCP Packet Injection on Google or Wikipedia. EtterCap is one such tool that allows to inject packets into established connections. However, this is definitely going into gray areas, as some of the tools are illegal in some countries.

Anyway, all of this is IMHO much too complicated. I don't know what exactly you want to do, but a specially prepared client or server is a much better tool to emulate certain behaviour while developing server or client applications. You can run them locally, or if you need to have different IP addresses or subnets you can do a lot with virtual machines.

南烟 2024-07-25 03:28:27

Indy 没有任何内置机制,但仔细想想,我建议构建一个小型测试应用程序(或套件),在您的开发计算机上本地运行并连接到您的 Indy 服务器应用程序以重放消息。

如果 TCP 连接是在本地或从远程主机建立的,那么它应该与您的 Indy 服务器应用程序无关,因为创建服务器线程和处理命令的机制对于这两种情况都是相同的。

我的上一次演出涉及使用 Indy,我们所有的测试都是使用类似的 Resender 类型应用程序完成的,该应用程序将加载本地消息文件并将其发送到 Indy 服务器应用程序。

祝你好运!

Indy doesn't have any built-in mechanisms for this but thinking off the top of my head I would recommend building a small test application (or a suite) that runs locally on your development machine and connects to your Indy server application to replay messages.

It should be irrelevant to your Indy server applications if a TCP connection is made either locally or from a remote host as the mechanisms by which a server thread is created and a command processed is identical to both scenarios.

My last gig involved using Indy and all our testing was done with a similar Resender type application that would load local message files and send these to the Indy server app.

HTH and good luck!

情归归情 2024-07-25 03:28:27

您可以做的一件事是创建虚拟机来运行您的测试客户端,这样它们就不会被视为“本地计算机”,并且使用 VMS 创建复杂的网络相当简单 - 前提是您有足够的内存和磁盘空间。 使用虚拟机进行测试的另一个优点是,您可以在专注于部署时完全消除开发环境。 令人惊讶的是,这节省了多少时间。

VirtualPC 可以从 Microsoft 免费下载,并且运行良好。 VMWare 还有另一种选择,但入门成本稍高一些。 出于开发目的,我更喜欢桌面版本,但服务器版本也运行良好。 您仍然需要拥有许可证才能安装虚拟操作系统。 MSDN 会员资格可能是最便宜的方式,并且可以让您为其他版本的操作系统构建测试环境。

One thing you can do would be to create virtual machines to run your test clients, that way they will not be seen as "local machine", and its fairly simple to create a complex network with VMS -- provided you have enough memory and disk space. The other advantage of testing with VM's is you can eliminate the development environment completely when its time to focus on deployment. Amazing how much time that saves alone.

VirtualPC is a free download from Microsoft and works fairly well. VMWare has another option, but costs a little more to get started. For development purposes, I prefer the desktop versions but the server versions also work well. You will still need to have a license to install the virtual OS. MSDN membership is probably the cheapest way to go, and allows you to build test environments for other flavors of the OS.

帅冕 2024-07-25 03:28:27

Indy 有跨平台支持的抽象堆栈机制(IDStack.pas)我认为你可以破解 Windows 堆栈(IdStackWindows.pas)。 这是一个类。 你甚至可以考虑派生它并重写一些函数来进行破解。

Indy has abstract stack mechanism for crossplatform support (IDStack.pas) I think u can hack the stack for windows (IdStackWindows.pas). It is a class. U can even consider to derivate it and override some functions to do the hack.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文