beyondcode / expose Goto Github PK
View Code? Open in Web Editor NEWA beautiful, fully open-source, tunneling service - written in pure PHP
Home Page: https://expose.dev
License: MIT License
A beautiful, fully open-source, tunneling service - written in pure PHP
Home Page: https://expose.dev
License: MIT License
This is a feature request.
It would be nice to be able to configure which host should be used to connect to the expose server and which base domain should be used to generate the links displayed client-side.
Example:
https://*.example.com
responds with the expose serverhttps://expose.example.com
shows the admin backendhttps://example.com
does not respond with the expose server but with a webpageAn easy workaround to still use expose is setting something.example.com as the host. This will work and correctly set up the forward. Unfortunately the client now tells me I can connect to https://jfh347y78y.something.example.com while https://jfh347y78y.example.com would be correct. That's why optionally setting the base domain would be practical.
I can PR a solution if you like.
Thanks for making this!
It took me a while to realize that the equivalent of ngrok http 3000
for expose is expose share localhost:3000
and still I'm not sure about it. Can you add a documentation page mapping ngrok terms to expose terms and similarly for the commands? I guess it will reduce friction for anyone trying to switch
server is running on Laravel Forge.
php 7.3
expose.mydomain.com, /sites and /settings is working, but when clicking the users tab, there is a 504 timeout and a generic nginx error page.
Hi,
I'm running an laravel app on docker over local url: abc.localhost:8010 and desire to share on internet using expose. I'm trying this:
expose share http://abc.localhost:8010
My app has a subdomain routes. abc
is a subdomain route of my app and this work fine. But expose return a timeout error: 504 Gateway Time-out
Any idea to solve this? I'll need to add nginx config about sharedwithexpose.com subdomain?
I'd like to expose my local site (running laravel on port 8000 for the backend, nuxt.js on port 3000 for the front-end) to others. How can I go about doing this?
I went through the installation and configuration steps here:
https://beyondco.de/docs/expose/getting-started/installation
https://beyondco.de/docs/expose/getting-started/sharing-your-first-site
https://beyondco.de/docs/expose/client/sharing
Then, I tried to expose just the laravel (backend) code (for now)
composer global require beyondcode/expose
expose token [YOUR-AUTH-TOKEN]
cd ~/Sites/my-awesome-project/
expose
But then https://my-awesome-project.sharedwithexpose.com does not load and gives an error: 502 Bad Gateway.
I also tried:
$ expose share 192.168.0.14:8000
Thank you for using Expose!
⭐️ Support us by starring the repo at https://github.com/beyondcode/expose ⭐️
---
Local-URL: 192.168.0.14:8000
Dashboard-URL: http://127.0.0.1:4040
Expose-URL: https://t0hb3wdq1o.sharedwithexpose.com
However, going to https://t0hb3wdq1o.sharedwithexpose.com doesnt load.
I see 502 Bad Gateway
How can I get this to work? I'd like to expose not just the laravel back-end, but also the nuxt front-end, which is supposed to communicate with the laravel back-end over APIs.
Library | Version |
---|---|
Expose | 1.0.1 |
Laravel | 7.16.1 |
PHP | 7.4.6 |
Platform | Mac |
lambo hotnewsite
.expose
❯ expose
Thank you for using Expose!
⭐️ Support us by starring the repo at https://github.com/beyondcode/expose ⭐️
---
Local-URL: hotnewsite.test
Dashboard-URL: http://127.0.0.1:4040
Expose-URL: https://hotnewsite.sharedwithexpose.com
+--------+-----+-----------------------+----------+
| Method | URI | Response | Duration |
+--------+-----+-----------------------+----------+
| GET | / | 301 Moved Permanently | 5ms |
| GET | / | 301 Moved Permanently | 30ms |
+--------+-----+-----------------------+----------+
It redirects to https://hotnewsite.test
Notes:
valet secure
).Would be great if, when shared, the URL was copied to the clipboard.
Fgg
I'm currently trying to get expose running with a custom domain. First of all, I had PHP 7.2 installed and ran into some errors while trying to run the "expose serve" command. There are no server requirements listed in the documentation. I switched to 7.3 and it works now.
I've successfully started the server and added it to supervisord (running on Laravel Forge). I have setup SSL and the reverse proxy. I can see an expose landing page on mydomain.com, but can't reach expose.mydomain.com. Do I have to add something to the nginx configuration to get this up and running?
What are the recommended DNS settings for running your own expose server? I have a wildcard ssl with route53 setup in laravel forge, I guess thats the correct way.
Further: I've run expose publish
to have a file to edit on the server, where I can set username and password for the admin interface. Couldn't find anything about this in the docs either.
I'm unable to expose a local site available at an address other than localhost
.
I can do the following with ngrok:
ngrok -host-header=rewrite http://something.local:80
See: https://ngrok.com/docs#http-host-header
It would be nice to have this feature in expose.
I'm using Expose on my local windows machine and running Laragon. Largon has ngrok support wich works fine, but limited on the requests (free plan).
When I run expose mysite.test
I get the following:
Local-URL: mysite.test
Dashboard-URL: http://127.0.0.1:4040
Expose-URL: https:// mysite.sharedwithexpose.com
When I go to https:// mysite.sharedwithexpose.com
the site comes up but all the CSS is missing because it's looking for the app URL which is https://mysite.test
that's in the .env
file.
(This happens with ngrok too.) When it happens on ngrok I go to a different page on my website and the CSS fixes itself.
When I go to a different page on my website with the Expose link it reverts back to the mysite.test
URL.
I'm also trying to use this to do Tests with the Stripe Webhook. But always returns a 500 server error
Is there something special I need to do to get this working with Laravel?
Any help would be appreciated.
Side note: If I remove https
and use http
the CSS comes back, but navigation links still revert back to https//mysite.test
(Css and links work fine here)
Can someone give me a hand with this?
ignacio in ~ λ composer -V
Composer version 1.10.8 2020-06-24 21:23:30
ignacio in ~ λ composer global require beyondcode/expose
Changed current directory to /Users/ignacio/.composer
[ErrorException]
file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory
require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...
I have a couple of questions regarding using Laravel with expose:
Laravel's route()
and url()
helpers both generate absolute URLs by default. This means all links in the site include the local URL, not the public "expose" URL. What's the best practice solution for resolving this situation when using expose?
should the .env
value for APP_URL
still contain the local URL, or the public "expose" URL?
I've noticed a bunch of issues here already which relate to one of the above, but haven't really seen a definitive answer. I'm more than happy to create a PR adding some documentation around this, once I understand how things should be handled.
Hey there, great app, thanks for building it!
I'm trying to get it set up on Forge. I can get it working (albeit not reading the published config file) until I enable SSL.
Do you have any instructions on how you're running it on Forge?
Thanks.
while running expose share
this the error i am getting
Could not connect to the server.
Connection to sharedwithexpose.com:443 failed during DNS lookup: DNS error
I installed using composer global require beyondcode/expose
and created a BeyondCode account and received an auth token for expose.
However when running expose token xxx-xxx-xxx
, it returns unknown command expose
.
And likewise, which expose
returns nothing. I am on a Mac with composer v1.8.4.
I had a nested folder named ~/Sites/product/demo
valet link product-demo.wip
expose used demo.wip
and 404s
composer global require beyondcode/expose , command not found: expose
I ran the installation as in the documentation:
composer global require beyondcode/expose
then I ran the command:
expose
and the result was:
expose: command not found
What did I do wrong? I am using Ubuntu 18.04. Thank you!
I've tried sharing a locally installed Wordpress site with Valet Plus, the site loads but no assets are getting imported. All Css/Js come up Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure script ''. This request has been blocked; the content must be served over HTTPS. If I use expose share https:// the valet server can't find the site on :443?
showing error as
In StoreAuthenticationTokenCommand.php line 27:
Undefined index: HOME
ngrok simply goes to the same public url not the local domain
I think that running
expose --subdmain=bar
in foo folder should set the basic config and use the custom given
https://bar.sharedwithexpose.com/
domain but rigth the share domain is
https://foo.sharedwithexpose.com/
iis this a bug or it's planned to works in that way???
Hey Marcel. thanks for that great project.
I'm installing Expose on Forge. it's working as expected. but for some reason it appends the :8085
to all clients` domain
Expose Server
expose serve my-custom-domain.com --port 8085
Client
expose share --subdomain local.test
local.test
is a valid project that works on my local through Valet
Then I get this in the dashboard - Note the port is appended
And this is the dd
of var_dump($_SERVER)
My Nginx configuration has proxy redirect off already
proxy_redirect off;
I'm having difficulty authenticating when I provide my token using
expose token my-actual-token
I get the response:
Setting the expose authentication token to
In TokenNodeVisitor.php line 20:
Trying to get property 'value' of non-object
Hey,
The composer.json specifies PHP 7.2.5 as the minimum requirement, but there are PHP 7.3 formatting rules being applied, which result in errors (see below). I can update my version pf PHP no issue, just putting this here as others may not be able to and could run into these issues.
https://github.com/beyondcode/expose/blob/master/app/Server/Factory.php#L212
When testing this out, I sometimes get the following error message
In UriFactory.php line 103:
no class registered for scheme "chrome-extension"
And then expose exits with exit code 1.
I ran the expose client with the -vvv
flag, and got the following stack trace:
In UriFactory.php line 103:
[Laminas\Uri\Exception\InvalidArgumentException]
no class registered for scheme "chrome-extension"
Exception trace:
at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/laminas/laminas-uri/src/UriFactory.php:103
Laminas\Uri\UriFactory::factory() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/laminas/laminas-http/src/Header/Origin.php:33
Laminas\Http\Header\Origin::fromString() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/laminas/laminas-http/src/Headers.php:472
Laminas\Http\Headers->lazyLoadHeader() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/laminas/laminas-http/src/Headers.php:426
Laminas\Http\Headers->toArray() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/app/Logger/LoggedRequest.php:293
App\Logger\LoggedRequest->getRequestId() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/app/Logger/LoggedRequest.php:48
App\Logger\LoggedRequest->__construct() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/app/Logger/RequestLogger.php:32
App\Logger\RequestLogger->logRequest() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/app/Client/Http/HttpClient.php:44
App\Client\Http\HttpClient->performRequest() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/app/Client/ProxyManager.php:48
App\Client\ProxyManager->performRequest() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/app/Client/ProxyManager.php:33
App\Client\ProxyManager->App\Client\{closure}() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
Ratchet\Client\WebSocket->emit() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/ratchet/pawl/src/WebSocket.php:72
Ratchet\Client\WebSocket->Ratchet\Client\{closure}() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php:200
Ratchet\RFC6455\Messaging\MessageBuffer->processData() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php:153
Ratchet\RFC6455\Messaging\MessageBuffer->onData() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
Evenement\EventEmitter->emit() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/react/stream/src/Util.php:71
React\Stream\Util::React\Stream\{closure}() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
Evenement\EventEmitter->emit() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/react/stream/src/DuplexResourceStream.php:193
React\Stream\DuplexResourceStream->handleData() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/react/event-loop/src/StreamSelectLoop.php:245
React\EventLoop\StreamSelectLoop->waitForStreamActivity() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/react/event-loop/src/StreamSelectLoop.php:212
React\EventLoop\StreamSelectLoop->run() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/app/Client/Factory.php:159
App\Client\Factory->run() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/app/Commands/ShareCommand.php:38
App\Commands\ShareCommand->handle() at n/a:n/a
call_user_func_array() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/illuminate/container/BoundMethod.php:33
Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/illuminate/container/Util.php:37
Illuminate\Container\Util::unwrapIfClosure() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/illuminate/container/BoundMethod.php:91
Illuminate\Container\BoundMethod::callBoundMethod() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/illuminate/container/BoundMethod.php:35
Illuminate\Container\BoundMethod::call() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/illuminate/container/Container.php:592
Illuminate\Container\Container->call() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/illuminate/console/Command.php:134
Illuminate\Console\Command->execute() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/symfony/console/Command/Command.php:258
Symfony\Component\Console\Command\Command->run() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/illuminate/console/Command.php:121
Illuminate\Console\Command->run() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/symfony/console/Application.php:911
Symfony\Component\Console\Application->doRunCommand() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/symfony/console/Application.php:264
Symfony\Component\Console\Application->doRun() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/symfony/console/Application.php:140
Symfony\Component\Console\Application->run() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/illuminate/console/Application.php:93
Illuminate\Console\Application->run() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Console/Kernel.php:129
Illuminate\Foundation\Console\Kernel->handle() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/vendor/laravel-zero/framework/src/Kernel.php:91
LaravelZero\Framework\Kernel->handle() at phar:///Users/thomas/.composer/vendor/beyondcode/expose/builds/expose/expose:46
require() at /Users/thomas/.composer/vendor/beyondcode/expose/builds/expose:14
The expose command fails on Windows 10 with this message:
Could not connect to the server.
Connection to sharedwithexpose.com:443 failed during TLS handshake: Unable to complete TLS handshake: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
First of all, let me say that you did an amazing job! Sometimes is really useful to expose my local environment for a quick test, I usually use Charles acting as proxy or ngrok, but expose will be even better since I can reserve my own subdomain!
Now the problem: when accessing my local environment the host header returned by my webserver is hardcoded, so when I expose with expose share mywebsite.local.com:443
and then go to https://something.sharedwithexpose.com I correctly see the web page served by my local environment but I get redirected to https://mywebsite.local.com, this because there is a redirection based in the host header and such header value is https://mywebsite.local.com instead of https://something.sharedwithexpose.com What ngrok offers to overcome this use case is a flag -host-header=rewrite
.
Quoting their doc
Rewriting the Host header
When forwarding to a local port, ngrok does not modify the tunneled HTTP requests at all, they are copied to your server byte-for-byte as they are received. Some application servers like WAMP and MAMP and use the Host header for determining which development site to display. For this reason, ngrok can rewrite your requests with a modified Host header. Use the -host-header switch to rewrite incoming HTTP requests.
If rewrite is specified, the Host header will be rewritten to match the hostname portion of the forwarding address. Any other value will cause the Host header to be rewritten to that value.
Rewrite the Host header to 'site.dev'
ngrok http -host-header=rewrite site.dev:80
Rewrite the Host header to 'example.com'
ngrok http -host-header=example.com 80
$ expose share https://mysite.test:3000 --subdomain=mysite
Thank you for using expose.
Local-URL: mysite.test:443:3000
As you can see, the specified port :3000
is replaced by :443:3000
.
Is there a way to force the port when using the https sharing format ?
TLS connections work fine but all links generated by Laravel point to http://{subdomain}.domain.tld:8080
instead of http://{subdomain}.domain.tld
. I guess this can be fixed with some proxy-setting in nginx?
While exposing my local site, the local URL's are still being loaded from the local domain.
Eg.
$ expose share somelocal.site --subdomain=somelocalsite
[...]
Local-URL: somelocal.site
Dashboard-URL: http://127.0.0.1:4040
Expose-URL: https://somelocalsite.sharedwithexpose.com
Shows the local site, but "somelocal.site" instances in source aren't rewritten to the Expose URL.
Though, I might have missed something in the docs.
Running Windows 10, PHP 7.4.2 and installed expose globally. Grabbed a token, and ran:
expose token XXXXX
with my token, and got this response:
Setting the expose authentication token to "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
In StoreAuthenticationTokenCommand.php line 27:
Undefined index: HOME
@mpociot, First of all, thank you very much for all the great effort that you have put into this project as an alternative to ngrok. This is very helpful and exciting.
The docs are great, but would it be possible to create a simple video tutorial on the usage of Expose
.
I am trying to share a Laravel Project at the root directory of the app, I get the URL, but it always ends up being a 404 error.
It will be good to have 2 videos.
sharedwithexpose.com
for Laravel projectsEven a quick Youtube Live would be great.
Hello, I am trying to share the project that uses laravel sanctum
I have configured sanctum with this:
SANCTUM_STATEFUL_DOMAINS = mysite.test
SESSION_DOMAIN = mysite.test
Site loads but cannot login (page 419 expired). If I change the url of SANCTUM_STATEFUL_DOMAINS and SESSION_DOMAIN with the exposure url, it works fine.
Is it possible to avoid this?
Both api (/api/users) and dashboard page (/users) fails while loading.
Standard composer installation with sqlite on php 7.4.3.
No errors appear in the logs also not with -vvv.
I am using oh my zsh on my command line. After installing expose via composer globally, when i type expose
it says command not found. I am on linux arch. Can you help me out?
Than you.
Hello,
I just started using the app, testing some payment webhooks and this error occurred:
PHP Fatal error: escapeshellarg(): Argument exceeds the allowed length of 8192 bytes in phar://.../Composer/vendor/beyondcode/expose/builds/expose/vendor/namshi/cuzzle/src/Formatter/CurlFormatter.php on line 137
In CurlFormatter.php line 137:
after which the app closed.
I'm on windows using PHP7.4
Hello. Thanks for this great piece of software.
I was wondering if it was possible to hide the port number in the Shared Sites tab.
I am running the server on port 8080, but behind a reverse proxy at 80/443.
This causes the list to display {subdomain}.{domain}:8080, which in my case is wrong.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.