GithubHelp home page GithubHelp logo

sock-proxy's Introduction

Slack Desktop app behind a SOCK proxy on macOS

Originally posted at http://www.vojtechvitek.com/posts/slack-desktop-app-behind-a-sock-proxy-on-macos-14045333

Are you behind a company network (or VPN) that restricts access to Slack? Or does the company force you to install a custom root certificate in order for you to log into a certain Slack team using SSO? Here's a solution for you.. First of all, you need a server that is outside of the restricted company network. Create a SOCK proxy to that server using SSH and keep the connection open:

ssh -D 8000 [username]@[server]
  1. Go to System Preferences
  2. Select your network interface (most probably WIFI or Wired connection)
  3. Click on Advanced..
  4. Click on Proxies tab
  5. Select and check off Automatic Proxy Configuration
  6. Paste in this URL: https://raw.githubusercontent.com/VojtechVitek/sock-proxy/master/slack-proxy.pac (you can see the content of the file below)
  7. Hit OK and Apply the changes

Applying proxy.pac configuration file hosted on Github on macOS Note: The proxy.pac file must be served from http[s]. Local files don't work on recent macOS systems, since file:// URLs are sandboxed. Use Github :)

function FindProxyForURL(url, host) {
    
    if (shExpMatch(host, "*.slack-msgs.com")) {        
        // Use SOCK proxy,
        // or fall back to a DIRECT traffic.
        // ssh -D 8000 [user]@[server]
        return "SOCKS 127.0.0.1:8000; DIRECT";
    }
    
    return "DIRECT";
}

Here you go. Slack is working again. Enjoy!

sock-proxy's People

Contributors

tjm avatar vojtechvitek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sock-proxy's Issues

Slack Desktop App (sshuttle)

We found that, while this socks proxy works for Slack in browser (Safari), It does not work for the Slack Desktop App. A potential workaround you can use, if you have a host you can SSH to that has access to "slack" and all other (internal?) resources you are trying to use is sshuttle (brew install sshuttle). It is only for Mac/Linux (not Windows), but it can be used to effectively "vpn" all your traffic to the target host. An added bonus is that it even works for the Slack Desktop app.

sshuttle --dns -r [user@]SSHSERVER 0/0
NOTE: This requires "sudo" access on client (laptop) side to do the port forwarding.

Then, any traffic that would go out of your computer is forwarded to the SSH host and originates from there instead. There are many other options, but with something like "Slack" where you have a rather dynamic list of hosts and IPs, we decided it would be easiest to just forward all traffic. YMMV.

It might be worth adding this (maybe with some polish) to the README?

https://www.unixmen.com/sshuttle-poor-mans-vpn-ssh/

~tommy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.