Commit Graph

56 Commits

Author SHA1 Message Date
Roman Shtylman
37df802cc0 Allow dash characters in subdomain.
Thank you @zackslash via https://github.com/localtunnel/server/pull/47

Rebased to latest master.
2018-04-01 18:04:48 -07:00
Ajay Gandhi
b1c296a409 Generate human readable IDs for client URLs (#77)
Based on @FranzSkuffka's suggested enhancement in PR 207 on
localtunnel/localtunnel
(https://github.com/localtunnel/localtunnel/pull/207), this PR uses the
"human-readable-ids" package to generate IDs of the form
"adjective-noun-number". These IDs are easier to remember and arguably
more useful in testing since they can be retyped without copying and
pasting.

Some sample IDs generated by this package are:

* heavy-puma-90
* grump-walrus-64
* purple-starfish-58
* nasty-seahorse-9
2018-04-01 18:00:21 -07:00
Roman Shtylman
3d6798a2bf fix api status endpoint 2017-12-11 21:29:11 -08:00
Roman Shtylman
5fb9dbaaa1 extract ClientManager from server.js
Make client manager more robust when piping connections.
2017-12-11 21:16:55 -08:00
Roman Shtylman
b4a36c78b0 replace express with koa 2017-12-10 11:34:29 -08:00
Roman Shtylman
9933611319 move proxy.js to lib/Proxy.js 2017-12-10 10:37:10 -08:00
Roman Shtylman
ab9b47d2b3 remove http-proxy dependency 2017-12-10 10:27:03 -08:00
Roman Shtylman
61708ec698 update book to 1.3.3 2017-12-10 10:22:00 -08:00
Jonas Finnemann Jensen
2539755155 Use generated id in the returned url (#59) 2017-12-10 08:35:44 -08:00
Roman Shtylman
30df06ff14 add memory usage to status api endpoint 2016-11-27 12:47:59 -08:00
Roman Shtylman
2a6561e774 add error handlers to requests and sockets
Trying to flush out cause of sporadic socket failures and identify which
socket is not being handled.
2016-11-27 09:50:14 -08:00
Roman Shtylman
eae9718ab3 redirect to github site for landing page
avoid proxying all the landing page requests
2016-07-24 21:34:34 -04:00
Roman Shtylman
dbf91cfa20 fix sending response when no client socket available 2016-07-10 22:24:20 -07:00
Roman Shtylman
a2a58f4c6f refactor with async/await
Trying to be more robust about error handling and failure.
2016-07-09 17:06:13 -07:00
Dom Scandinaro
4ee7a6738f fixed issue with response code and headers 2015-12-16 09:42:48 -06:00
Siddhartha Sahai
7923e80b08 increased subdomain character limit to 63 2015-11-17 21:08:36 +05:30
Roman Shtylman
f8fa049966 remove bouncy
rework request proxy to use native http request and direct socket pipe.
Cuts out bouncy which is no longer maintained and simplifies the code
path.
2015-11-04 20:01:01 -08:00
Roman Shtylman
41b7e3f63d proxy to github pages site for landing page
- removes all the website specific cruft from the repo
- allows for rolling out website changes separately from server changes
2015-08-02 11:06:46 -07:00
Roman Shtylman
386910032e fix websocket support 2015-01-10 20:58:11 -08:00
Siddhartha Sahai
fa4802d488 disallow uppercase domains, with test 2015-01-03 04:39:09 +05:30
Roman Shtylman
4dd37bda60 update dependencies 2014-12-11 09:32:00 -08:00
Roman Shtylman
73ec1865ab remove engine.io
No need for homepage to show this stuff for now. Just more things that
can crash the tunnel server!
2014-10-25 17:09:13 -07:00
Roman Shtylman
4a09dc114a better handling of requests that die 2014-10-25 16:59:16 -07:00
Roman Shtylman
13bf109a6e don't log client connection errors 2014-04-28 11:40:06 -04:00
Roman Shtylman
55feebdb9a don't log bounce errors, just destroy the socket 2014-04-23 12:12:12 -04:00
Roman Shtylman
7ecef6b69c make done a no-op if not provided 2014-04-23 12:10:51 -04:00
Roman Shtylman
1b1d75b750 detect when http client request is finished and close connection
If the request is finished before we need to respond, we set a flag and
close the connection.

We also close the connection when the request finishes anyway because we
really like a new connection for each request. Things play nicer with
bouncy that way.
2014-04-22 20:34:13 -04:00
Roman Shtylman
7fedb06bf9 remove old stats object properties 2014-04-22 19:48:11 -04:00
Roman Shtylman
9e89e863a3 remove request count on homepage 2014-04-22 19:41:10 -04:00
Roman Shtylman
8cc22d501c fix bad matching against subdomains
Match for valid subdomains versus anything that comes before a period.

fixes #7
2014-04-20 12:58:59 -04:00
Roman Shtylman
8abb4f395f add test for invalid subdomain requests 2014-04-20 11:05:57 -04:00
Roman Shtylman
873bafc1f6 allow subdomains up to 20 characters
- error out of subdomain outside of acceptable range
- don't check ranges in client id regex capture. If there is no client,
  just give a no client message instead of redirecting to service
  landing page

fixes #40
2014-04-16 22:46:21 -04:00
Roman Shtylman
bc80e37fff handle engine.io websocket errors more gracefully 2014-02-25 11:54:40 -05:00
Roman Shtylman
54ba65ba1f bump length of subdomain to 10 2013-12-31 15:33:43 -05:00
Roman Shtylman
e08ee1edbb fix handling of new requests for generated client id 2013-12-21 10:45:19 -05:00
Roman Shtylman
b6abd16383 update landing page
- restyle
- add sponsors
2013-11-22 17:57:26 -05:00
Roman Shtylman
ae73e16ac2 add --secure flag to indicate proxy can support https requests
When --secure is set, all urls will be sent back with https so use will
use secure proxy.
2013-11-21 21:16:59 -05:00
Roman Shtylman
a4f5ceb4bc https by default for urls 2013-11-21 21:10:33 -05:00
Roman Shtylman
af2c727b41 fix upstream client disconnect handling
When upstream client disconnects, kill any waiting connections. This is
needed to inform the browser that the upstream connection is no longer
available and to close the socket so a new one will be created for new
requests.
2013-11-06 23:06:59 -05:00
Roman Shtylman
0bba03ccd2 fix processing queued requests 2013-11-04 10:30:54 -05:00
Roman Shtylman
6afb75704a use bouncy to proxy requests
- simplifies our codebase a lot!
- queued requests are currently broken
2013-11-03 16:56:41 -05:00
Roman Shtylman
b0e94c9784 explicitly set view dir 2013-06-18 23:15:48 -04:00
Roman Shtylman
d15e568cea refactor server
* shows some basic statistics on main page
* move tcp proxy setup into separate file
* migrate github page theme to be hosted locally
2013-06-18 23:00:45 -04:00
Roman Shtylman
e6971e9afe use bookrc for logging 2013-06-16 18:50:04 -04:00
Roman Shtylman
0568ae0bef close client tcp sockets after each http response
While a little less efficient than keeping tcp connections open, this
helps ensure that bad things don't happen on the socket connections when
http protocol issues happen.
2013-06-16 18:24:27 -04:00
Roman Shtylman
5c6558ed91 fix missing query parsing in server 2012-12-17 14:31:05 -05:00
Roman Shtylman
79ca069c38 refactor to use http-raw for lt server incoming
- http raw exposes a socket to the req/res pair
- cleanup client to be more resilient
- add test for queued requests
2012-12-17 14:23:12 -05:00
Roman Shtylman
b605e9b823 server: make sure client id are released when unused
When clients disconnect, their tcp server should be shutdown and the id
released after a grace period.
2012-11-14 13:53:33 -05:00
Roman Shtylman
51d91ce0e8 refactor server tcp handling
- limit on number of tcp connections
- preliminary support for websockets
2012-10-17 22:50:59 -04:00
Roman Shtylman
72a3740dbd parse query from url 2012-10-16 23:22:46 -04:00