开发者

Is it possible to capture an outgoing http call from an ActionScript (Flex) module?

开发者 https://www.devze.com 2023-02-04 07:25 出处:网络
I\'m trying to develop a test framework for some ActionScript code we\'re developing (Flex 3.5). What\'s happening is this:

I'm trying to develop a test framework for some ActionScript code we're developing (Flex 3.5). What's happening is this:

As part of a Web Analytics function we are calling a track method in a class, providing the relevant information as part of the call. This method is provided 开发者_如何学JAVAin a library (SWC), and we have no access to the code.

Ultimately the track method sends an outgoing http request to the tracking server. We can see this quite happily in HttpFox.

I was hoping to be able to capture this outgoing request and interrogate it in my test class, allowing us to a) run tests in a more standalone fashion, and b) programmatically determine that the correct information is being tracked.


No problem just run this developer tool that displays all requests leaving your machine.

http://www.charlesproxy.com/


Unless you're going to use a sniffing tool, which probably would be hard to use for a programmatic evaluation, I would recommend using a proxy to channel your request. You could let the track method send the request to a php script on the proxy server, have it evaluate the request content, and then forward it to the actual tracking server. I suppose on a tracking system, you won't need to worry about the response, so it shouldn't be too hard to implement.


You could run a web server on a localhost (or any really) and just make sure the DNS entry the code is trying to access points to the server you are running.

0

精彩评论

暂无评论...
验证码 换一张
取 消