From 8f592f6f506fbf48b81b2104668d052bdd6d8293 Mon Sep 17 00:00:00 2001 From: Matt Jakubowski Date: Mon, 23 Jan 2023 16:07:40 -0600 Subject: [PATCH] added another nginx config example --- server/readme.md | 4 +++- server/studio-app.snapchat.macos.nginx.conf | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 server/studio-app.snapchat.macos.nginx.conf diff --git a/server/readme.md b/server/readme.md index 2ea16c4..cdb279f 100644 --- a/server/readme.md +++ b/server/readme.md @@ -41,7 +41,9 @@ Starting with nginx, we have the example snap.nginx.conf file. We use nginx to p In the nginx config and in the section above I mentioned you should make sure your domain is 23 characters long. The reason for this at least on the PC patching part is that we are just replacing the domain that snapchat uses with our own. When replacing a hostname or anything like that in a binary that has been compiled having extra or less characters can cause issues. I don't know if having a domain with 22 characters will work or not, but I know 23 will and so my instructions state that. Feel free to do do your own testing but I won't be able to help you if you're not using 23 characters. In my case the domain we are using is ``snapchatreverse.jaku.tv``, I am using a subdomain and so you can do that same to match the character amount you need if your domain itself isn't long enough. -The above instructions all will only work for PC users, the MacOS configuration is different and I'll explain the concept. You'll still need an nginx file, but not the same one as the PC. On PC we're actually patching the host that we're communicating to, on MacOS we're tricking it into believing my server is the original snap camera server. We do this by adding a ``/etc/hosts`` entry for ``studio-app.snapchat.com``. So our nginx file will need to reflect that as well, instead of our own custom domain. Additionally we need to generate a self-signed certifcate for the domain ``studio-app.snapchat.com`` and then install the certificate and trust it on MacOS. You can google to figure out how to do all that, I don't have the instructions I followed saved anywhere. +The above instructions all will only work for PC users, the MacOS configuration is different and I'll explain the concept. You'll still need an nginx file, but not the same one as the PC. On PC we're actually patching the host that we're communicating to, on MacOS we're tricking it into believing my server is the original snap camera server. We do this by adding a ``/etc/hosts`` entry for ``studio-app.snapchat.com``. So our nginx file will need to reflect that as well, instead of our own custom domain. Additionally we need to generate a self-signed certifcate for the domain ``studio-app.snapchat.com`` and then install the certificate and trust it on MacOS. You can google to figure out how to do all that, I don't have the instructions I followed saved anywhere. I've added the `studio-app.snapchat-macos.conf` file to the repo as an example. + +The cert/hosts file setup could also be done on Windows instead of patching a file, so if you only want to do one setup type and support both versions, I'd suggest that route. This gets communication working between your copy of Snap Camera and my servers. The application itself uses REST for all of it's communication. diff --git a/server/studio-app.snapchat.macos.nginx.conf b/server/studio-app.snapchat.macos.nginx.conf new file mode 100644 index 0000000..de1c79d --- /dev/null +++ b/server/studio-app.snapchat.macos.nginx.conf @@ -0,0 +1,17 @@ +server { + listen *:443; + server_name studio-app.snapchat.com; + + ssl_certificate /your/path/to/the/nginx/snapchat-certs/studio-app.snapchat.com.crt; + ssl_certificate_key /your/path/to/the/nginx/snapchat-certs/studio-app.snapchat.com.key; + + location / { + proxy_redirect off; + proxy_http_version 1.1; + proxy_pass http://127.0.0.1:5645; + proxy_set_header Host $host ; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + +} \ No newline at end of file