WebFaction
Community site: login faq

I want to have two custom apps running on my shared hosting account. Both of them would speak http on their assigned ports. The first app will be mapped to a website and the second app will be a service for the first app.

Is there any way to make sure that only my own apps can talk to the service app?

If that's not possible, then my first thought (to avoid developing a full auth system) is to have the service speak https and include an auth token in query params (which are encrypted in https) on every request from the website app. Does that sound like a realistic plan?

asked 22 Feb, 20:27

Crantok's gravatar image

Crantok
1517
accept rate: 0%


Is there some reason you need them to communicate via HTTP? If they're running on the same machine, then using a filesystem socket (in your home directory) for communication would be more secure, and probably faster.

If that's not an option for you, then you'll have to use some form of authentication+encryption. Your auth token idea seems reasonable, as long as it's only passed in encrypted POSTs.

permanent link

answered 23 Feb, 00:51

seanf's gravatar image

seanf ♦♦
11.3k21132
accept rate: 37%

Thank you. I'm working in Go and, amazingly, it looks like Go is able to speak http over a unix socket: https://github.com/gin-gonic/gin/blob/52fcc5dbf6e94df33ad313858fb94b713e9d1b4a/gin.go#L254 Awesome.

(23 Feb, 20:12) Crantok Crantok's gravatar image

Nice find!

(23 Feb, 21:18) seanf ♦♦ seanf's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×20
×1

question asked: 22 Feb, 20:27

question was seen: 119 times

last updated: 23 Feb, 21:18

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM