Using nginx as a websocket proxy?

190 views
Skip to first unread message

fba

unread,
Aug 12, 2016, 6:06:23 PM8/12/16
to OpenSTF
Hi all,

I have a weird setup question.

I have OpenSTF set up at our corporate offices.   As part of the cluster there, I have a half dozen devices.   However, I have a 2nd stf-provider instance here at a remote site.   The main OpenSTF server at the corporate offices can see the devices here at the remote site.   However, there is a firewall between some of the networks at the corporate offices, and my remote site that prevents some of our users from being able to access devices here at the remote site.   I'm pretty sure it is because of the websocket that is used to send the screen cast data from the device.

So, while I understand there will be some performance impact, is there any way to have nginx proxy the websocket connection for streaming the screen data?

From the network perspective (in case my above description is unclear), the OpenSTF cluster is allowed to talk to the provider machine at the remote site.   But, some of the users at the corporate site are unable to talk to the remote site.   So, the goal would be to make the websocket stream appear to come from the cluster that is at the corporate site.

Hopefully one of these two descriptions makes sense!

Thanks!

Simo Kinnunen

unread,
Aug 12, 2016, 10:12:33 PM8/12/16
to fba, OpenSTF
Do you run STF on port 80? If so, it will never work reliably on Windows at least. Use a different port, preferably 443 (with TLS if possible).

--
You received this message because you are subscribed to the Google Groups "OpenSTF" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openstf+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openstf/396789ea-7863-483c-bd0b-35e3a699babf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

fba

unread,
Aug 16, 2016, 12:32:22 PM8/16/16
to OpenSTF
Hi Simo,

I am using HTTPS.   And, much to my surprise when I turned on the remote provider today, the web sockets were being proxied through the server I wanted them to be.   So, it must have been some weird glitch in my configuration that was causing it not to behave properly.

Everything seems to be working perfectly now!  Thanks for all the hard work you guys put in!

BTW - I saw somewhere in the documentation what I think was probably meant to be a joke.   There was a comment along the lines of "if you mine bitcoin and happen to get any, send us a few".   The one issue I had with that comment is that there wasn't a wallet address listed.   I don't mine bitcoin, but I do have some bots that trade and make a little bit here and there.   I wouldn't mind kicking a little bit over to you guys from time to time, if it would help at all.   It wouldn't be a ton, because my bots don't make a ton.  But, it might help out with hosting fees or something like that.

Thanks!


On Friday, August 12, 2016 at 8:12:33 PM UTC-6, Simo Kinnunen wrote:
Do you run STF on port 80? If so, it will never work reliably on Windows at least. Use a different port, preferably 443 (with TLS if possible).
On Sat, Aug 13, 2016 at 7:06 AM, fba <open1x...@gmail.com> wrote:
Hi all,

I have a weird setup question.

I have OpenSTF set up at our corporate offices.   As part of the cluster there, I have a half dozen devices.   However, I have a 2nd stf-provider instance here at a remote site.   The main OpenSTF server at the corporate offices can see the devices here at the remote site.   However, there is a firewall between some of the networks at the corporate offices, and my remote site that prevents some of our users from being able to access devices here at the remote site.   I'm pretty sure it is because of the websocket that is used to send the screen cast data from the device.

So, while I understand there will be some performance impact, is there any way to have nginx proxy the websocket connection for streaming the screen data?

From the network perspective (in case my above description is unclear), the OpenSTF cluster is allowed to talk to the provider machine at the remote site.   But, some of the users at the corporate site are unable to talk to the remote site.   So, the goal would be to make the websocket stream appear to come from the cluster that is at the corporate site.

Hopefully one of these two descriptions makes sense!

Thanks!

--
You received this message because you are subscribed to the Google Groups "OpenSTF" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openstf+u...@googlegroups.com.

Simo Kinnunen

unread,
Aug 16, 2016, 1:09:05 PM8/16/16
to fba, OpenSTF
Hi,

Good to hear you got it working. The network configuration is admittedly a bit difficult.

I'm not sure where that bitcoin thing is, shouldn't be in the docs at least. I very vaguely remember one post from a long, long time ago about someone wanting to mine bitcoins on their phones using STF, which would of course be a very bad idea due to the inefficiency and overheating. Maybe that's the one?

Albeit not huge, we do have running costs associated with our various service accounts. Obviously we're not going to refuse if you'd like to help us with those a bit or occasionally support the project in general, in fact it would be much appreciated. For now, I've set up 3MgvKXehh2v3urD4yivr9BTbELyHQeUGo2 if you'd really like to offer some BTC. Note to future visitors: if you found this post via Google, ensure that the address is still valid.

Either way, thanks for the offer!

Simo



To unsubscribe from this group and stop receiving emails from it, send an email to openstf+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

fba

unread,
Aug 29, 2016, 12:00:15 PM8/29/16
to OpenSTF
Hi Simo,

I'm a little slow, so I just saw your response today.   (Need to stay on top of this stuff a bit better.)   I'll kick a little bitcoin your way sometime this week.   I'll also send a little every now and then when I think about it, and when my bots have done well.   It won't be a ton, but maybe it'll help offset some of the costs.  (As an aside, it might be a good idea to put the address in the documentation, and maybe even on the home page for the program.   Well, assuming you guys are okay accepting bitcoin and using it.    Also, feel free to use the bitcoin however you see fit.   If maid cafes (cuz I think I saw you guys were located in Japan  (I *LOVE* Japan!  Been there twice, and loved it both times!!!)) and booze is what you guys need to keep up the work, go for it!

I was SO excited when I discovered OpenSTF, and am still extremely happy that you guys have built this!    This week, I'm boxing up the 36+ devices I have laying around my little home office, and shipping them out to our corporate offices to be hooked up to OpenSTF out there, so that both our development team, and our support team with have access to all of the devices!   I've also been using OpenSTF heavily the last couple of weeks for development with Qt from a Linux box.

Also, speaking of donations, I have a dozen or two device database definitions that seem to be correct.   I'm fighting my way through the slower than molasses legal process here at the company I work for.   (Been working on it for 8 months now!  I'm about to e-mail the CEO and ask for someone to get a spanking!)   I hope at some point to be able to contribute that data back.  I'm just dumbfounded at how painful this process has been.   The data is all publicly available, but the lawyers are acting like it is top secret corporate data. 

As for the network configuration, it is a little difficult.   And, for my question, throwing a VPN and a firewall in the middle of it only made it worse!   I did manage to get it working, but the results were less than satisfying.  The remote devices would work fine for a little while, but they would eventually either disappear from UI, or they would still show up, but when you attempted to use them you couldn't see the screen.   I suspect it may have something to do with how crappy my Internet connection to my home office is.   It likes to go up and down a lot, and at random.

Thanks!!  (Sorry for going all fan-boy on you there for a second. ;)
Reply all
Reply to author
Forward
0 new messages