browserup / browserup-proxy

BrowserUp Proxy is a free utility to watch, test, and manipulate web application network traffic and performance.
https://browserup.com
Apache License 2.0
164 stars 41 forks source link

proxy cannot be restarted #274

Closed 2x2xplz closed 4 years ago

2x2xplz commented 4 years ago

Describe the bug proxy thinks it is in both started and stopped modes simultaneously. This is a problem because it cannot be restarted (throws an IllegalState error)

To Reproduce Steps to reproduce the behavior (Kotlin):

val buProxy : BrowserUpProxyServer = BrowserUpProxyServer().apply { this.start(8002) }
... drive some Selenium code ...
buProxy.stop()
println(buProxy.isStarted && buProxy.isStopped) // returns true

Expected behavior after buProxy.stop() , I expect isStarted to be false, and subsequent buProxy.start() command would not throw an "already started" error

Screenshots image

Please complete the following information:

Additional context Same behavior exists in BrowserMob. I "upgraded" to BrowserUp, thinking this may have been fixed, but seeing the same issue in both packages.

2x2xplz commented 4 years ago

not sure why I didn't see this earlier, but apparently this behavior is originally by design: https://github.com/lightbody/browsermob-proxy/issues/264#issuecomment-112933259

BMP is not currently meant to be stopped and restarted.

With that said, this is a new project and new company, perhaps it is worth reconsidering whether no-restarts is the best option, or if it should be implemented.

ericbeland commented 4 years ago

We have a new implementation coming out. I'm closing for now. I think we may end up doing this along the way, though.