Git Product home page Git Product logo

Comments (11)

bitbound avatar bitbound commented on July 22, 2024

Unfortunately, I have no experience with Apache nor the time to set it up and test.

It sounds like the websocket connection is not successfully upgrading. It does a handshake process first over https, then upgrades to wss.

You'll notice in the Nginx config that there's special handling for the Upgrade and Connection headers. You'll need to replicate that part as well.

I'll keep this open for a bit. Let me know how it goes!

from remotely.

agottschling avatar agottschling commented on July 22, 2024

Sorry that it took me so long to get back to this, but I did end up getting it to work. Attached is a stripped down config for Apache2.4 that removes everything personal to my server. Feel free to include it as an option for those who don't want or can't load Ngnix.

<IfModule mod_ssl.c>
<VirtualHost *.443>
        ServerName {FQDN}
        ServerAdmin {Admin Email}
	
	#Forward once Websocket Connection has been upgraded.
	RewriteEngine On
	RewriteCond %{HTTP:Upgrade} =websocket [NC]
	RewriteRule /(.*)           ws://localhost:5000/$1 [P,L]
	RewriteCond %{HTTP:Upgrade} !=websocket [NC]
	RewriteRule /(.*)           http://localhost:5000/$1 [P,L]

	ProxyPreserveHost On
	#Proxy Requests to Remotely Server
	<LocationMatch "/">
		ProxyPass http://localhost:5000/ 
		ProxyPassReverse http://localhost:5000/
	</LocationMatch>
	<Location "/BrowserHub">
		ProxyPass http://localhost:5000/
		ProxyPassReverse http://localhost:5000/
	</Location>

	<LocationMatch "/DeviceHub">
		ProxyPass http://localhost:5000/
		ProxyPassReverse http://localhost:5000/
	</LocationMatch>

	<LocationMatch "/RCBrowserHub">
		ProxyPass http://localhost:5000/
		ProxyPassReverse http://localhost:5000/
	</LocationMatch>

	<LocationMatch "/RCDeviceHub">
		ProxyPass http://localhost:5000/
		ProxyPassReverse http://localhost:5000/
	</LocationMatch>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        SSLCertificateFile {Path to fullchain.pem}
	SSLCertificateKeyFile {Path to key.pem}
	Include /etc/letsencrypt/options-ssl-apache.conf #Change this to wherever your apache options for LE are, or ignore if you don't use LE
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</IfModule>

Remotely A2.4 Config.conf.txt

from remotely.

bitbound avatar bitbound commented on July 22, 2024

Awesome! Thanks! I'll include this in the Utilities folder as an example.

from remotely.

Zeik0s avatar Zeik0s commented on July 22, 2024

Hey @jay-rad, please put the file in the Utilities folder. Took me quite some time to find the apache sample config. πŸ˜‰

from remotely.

bitbound avatar bitbound commented on July 22, 2024

@Zeik0s Sorry! I thought I did, but messed up. I uploaded it now. :)

from remotely.

Zeik0s avatar Zeik0s commented on July 22, 2024

@agottschling I tried your config for apache, i am still getting the errors. I am using plain http for testing, can this be the reason?

from remotely.

agottschling avatar agottschling commented on July 22, 2024

@Zeik0s This config is built for an SSL site. What errors are you gettings?

from remotely.

Zeik0s avatar Zeik0s commented on July 22, 2024

Every few seconds a little window pops up with a message "the connection was lost, please reconnect" or something like that. I am currently not in range of the PC i am testing on.

from remotely.

Zeik0s avatar Zeik0s commented on July 22, 2024

I know, i commented every ssl related line out, so basically it should be fine. Of course i changed the Port to 80.

from remotely.

agottschling avatar agottschling commented on July 22, 2024

Another thing to check is if mod_proxy_wstunnel is enabled. If it's not, that would explain why it's not working.

from remotely.

Zeik0s avatar Zeik0s commented on July 22, 2024

I haven't, i only enabled mod_proxy and mod_proxy_http. Will try it later, thx a lot.
Edit: it works now and the device is connected.

from remotely.

Related Issues (20)

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.