XWebView icon indicating copy to clipboard operation
XWebView copied to clipboard

XWebView should expose port number or receive a preferred port number

Open fernandodev opened this issue 10 years ago • 1 comments

I think in some cases is conviniente to retrieve current port number of local http server or maybe a way to preset it (I know it can conflict but it's an embedded server maybe it shouldn't occur)

Other point is when use more than one WKWebView instance (like in a page view controller). Is really necessary to instantiate one http server for each instance, I don't think so. For this case I suppose that is better to extract http server in a singleton or any other pattern.

But with a preferred port number can solve both of them because if server is already running they should not start again. A common problem can be the case when have more than one base Urls ... but it's more a project question than a problem et al

fernandodev avatar Oct 21 '15 11:10 fernandodev

Sorry for reply late.

The http server is intent to be transparent to embedders by design. However, I can be convinced if you have a reasonable case that indeed requires to know the port number.

Multiple WKWebView instances can share a same http server, but it means they share the same resource directory. This may cause security issues.

The iOS 8 support is expected to be removed in a seeable future. The http server will serve for overlay support only. If we can find a better approach to implement overlay (like URL intercept), I will remove the http server also.

xwv avatar Dec 18 '15 15:12 xwv