mistakster / throttle-proxy

Throttle HTTP/HTTPS/SOCKS proxy server
121 stars 24 forks source link

Added support for a --match flag #2

Closed michaek closed 11 years ago

michaek commented 11 years ago

This commit adds support for a URL matching flag, --match. As there aren't existing tests, I didn't add my own, and I can only confirm anecdotally that this works in my informal testing and doesn't break existing behavior in those cases.

mistakster commented 11 years ago

@michaek, thanks for improvement. I'll approve pull-request and update NPM as soon as possible.

By the way, do you think that use Regex instead of common wildcard symbols is a good way? In my opinion, * or ? is much cleaner and understandable. Also, . character has special meaning in Regex. I think, is better to convert wildcarded string to Regex string manually. I'll rise an issue and try to fix this case.

michaek commented 11 years ago

I'm also not sure that the RegExp approach that I took was the best, but I thought it made sense to make it as simple as possible. I was hoping that there'd be a way to pass in an escape, like \. if the wildcard nature of . was causing problems, but I'm not sure that's possible in the way I imagined it at first.

Thanks for your quick response!

mistakster commented 11 years ago

@michaek I've just released v0.3.0 with --match and --skip patterns. Check it out. Any feedbacks are wellcome.

michaek commented 11 years ago

Looks awesome. Thanks!