Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    websockets and Squid

    Scheduled Pinned Locked Moved Cache/Proxy
    3 Posts 1 Posters 533 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JonathanLeeJ Offline
      JonathanLee
      last edited by JonathanLee

      Has anyone else used this custom Squid configuration to handle protocol upgrades? It allows real-time applications like Microsoft Teams, Office, and Facebook Messenger to establish WebSocket connections. Without these directives, Squid blocks the protocol upgrade request and drops the connection:

      Squid

      http_upgrade_request_protocols websocket allow all
      http_upgrade_request_protocols OTHER deny all

      Updated: see below

      Please let me know if my understanding of this behavior is correct!

      This has improved performance as it is helping everything run more smoothly now.

      Make sure to upvote

      1 Reply Last reply Reply Quote 0
      • JonathanLeeJ Offline
        JonathanLee
        last edited by

        I found a researched and found a more secure way I wanted to share:

        acl localnet_v6 src [insert your ipv6 subnet here]
        http_upgrade_request_protocols websocket allow localnet
        http_upgrade_request_protocols websocket allow localnet_v6
        http_upgrade_request_protocols OTHER deny all
        

        This way only your devices can authorize the websocket requests.
        follows the principal of least privilege.

        Make sure to upvote

        1 Reply Last reply Reply Quote 0
        • JonathanLeeJ Offline
          JonathanLee
          last edited by

          This fix really helps a lot with performance issues for me. Enjoy

          Make sure to upvote

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
          Privacy Policy · Cookie Policy