symfony / symfony-docs

The Symfony documentation
https://symfony.com/doc
Other
2.18k stars 5.13k forks source link

[LocalWebserver] Local Proxy: there is a missed step #12888

Closed Aerendir closed 4 years ago

Aerendir commented 4 years ago

I'm trying to use the Local Proxy from the Symfony Local Webserver.

I followed the instructions but the proxy doesn't work.

I opened a question on Stackoverflow about the issue: https://stackoverflow.com/questions/59601720/symfony-local-web-server-impossible-to-use-local-proxies?noredirect=1#comment105370015_59601720

I think that, if I'm having problems, other will, too.

It may be a good idea to add to the documentation the missed step to make the Local Proxy work (once the cause of the issue will be found and the problem solved).

javiereguiluz commented 4 years ago

I added a reply on your StackOverflow question. In summary: I'm suing Symfony CLI, macOS, etc. like you ... this feature works ... perfectly when using Firefox and occasionally when using Chrome.

Aerendir commented 4 years ago

Hi @javiereguiluz , thank you for your reply... Later I will go to read also your one on Stackoverflow...

Searching on Google, I saw that I should also configure my network adding the pac file: this is not reported in the docs (but is in some slides by Fabien)...

Did you set the pac file?

javiereguiluz commented 4 years ago

Yes, I set the PAC file. Actually, that's the first step explained in the docs, right? I followed these instructions: https://symfony.com/doc/current/setup/symfony_server.html#setting-up-the-local-proxy

Aerendir commented 4 years ago

I completely missed it! 😳

Anyway later I will try with firefox, but as for what I remember, I didn't worked, too...

Aerendir commented 4 years ago

Finally I get it to work in a predicatable way.

Before, I started the proxy with Chrome already started: Proxy server didn't work.

Then I read a small advice online, a not in a very big post: "completely restart Chrome".

So, this is the solution:

  1. Start the Proxy
  2. Completely close Chrome, all windows, all of all: right click on the icon in the dock, then quit (or exit, I don't know which is the label in English. In Italian is "Esci", the last item in the contextual menu)
  3. Open Chrome again

The Proxy at this point should work as expected.

@javiereguiluz , can you, please, confirm that following those steps Chrome stops to work intermittently and instead starts to work predictabily?

If it works in a predicatble way, then I thin this small advice (completely restart the browser) should be added to the documentation as it took me a lot of days and a bit of luck and serendipity before discovering the "trick" (and I was reading about completely different things!).

javiereguiluz commented 4 years ago

Sorry for the late reply. You are right and the "full browser restart" is the missing step. I've verified that this is the right solution. We've created #13517 to fix this in the docs. Thanks.

martinbroos commented 2 years ago

I experienced the same problems but only in the latest version of Safari (15). Turned out that when setting the proxy there is a field which says: Bypass proxy settings for these hosts. Which contains .local

Looks like Google Chrome will ignore this but safari is more strict about this and doesn't use the proxy config. By removing *.local from this list and do a browser restart in started working again.

Maybe this helps someone, or this could also be part of the docs if more people are experiencing the same problem in Safari 15.

proxy-settings
javiereguiluz commented 2 years ago

@martinbroos this has been improved in #16475. Cheers!