Jeffail / leaps

A pair programming service using operational transforms
MIT License
754 stars 55 forks source link

reverse proxy support #31

Closed qknight closed 8 years ago

qknight commented 8 years ago

reverse proxy setup

i tried to run leaps behind a reverse proxy, say:

https://example.com/leaps -> localhost:8080/leaps

or

https://example.com/leaps -> localhost:8080/
(this would require a different apache proxy configuration as shown below)

but i did not find a way to make leaps know it runs in a subdirectory. is there a configuration option?

apache config

# prevent a forward proxy! 
ProxyRequests off

# User-Agent / browser identification is used from the original client
ProxyVia Off
ProxyPreserveHost On

RewriteEngine On
RewriteRule ^/leaps$ /leaps/ [R]

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /leaps/ http://127.0.0.1:8080/leaps/ retry=0
ProxyPassReverse /leaps/ http://127.0.0.1:8080/leaps/

question

does anyone here have a working reverse proxy setup for apache or any other WS?

Jeffail commented 8 years ago

Hey @qknight, unfortunately the binary doesn't have that config option, but it would be trivial to add.

https://github.com/Jeffail/leaps/blob/master/cmd/leaps/leaps.go#L56 <- We add a flag there called -path which will be the root path (in this case we'd set it to /leaps.

https://github.com/Jeffail/leaps/blob/master/cmd/leaps/leaps.go#L67 <- We use the flag here, hPath = path.Join(*httpPath, hPath).

If I get time I can add it in pretty quickly.

qknight commented 8 years ago

nice. i will play with it and tell you if it works!

qknight commented 8 years ago

@Jeffail here is the wanted help: https://github.com/Jeffail/leaps/pull/32

qknight commented 8 years ago

@jeffail could you please provide the script you are using to build the asset go file? i would rather be able to do it myself and it should be part of the 'go build' so that ppl can change their own files.

Jeffail commented 8 years ago

Hey @qknight, it's these steps here: https://github.com/Jeffail/leaps/blob/master/cmd/leaps/package.go#L31 go get the packages and then run go generate within the ./cmd/leaps directory.

qknight commented 8 years ago

hey @Jeffail, we should focus on integrating these into the building process itself.

qknight commented 8 years ago

i've added a new issue: https://github.com/Jeffail/leaps/issues/33 for the bindata_assetfs.go problem

qknight commented 8 years ago

when https://github.com/Jeffail/leaps/pull/32 was merged, this issue can be closed!

Jeffail commented 8 years ago

Merged, had some fun diagnosing issues with strip prefix on empty paths and had to add some voodoo, might want to retest your use cases but you should be good to go.