Client Authentication #108

Open
opened 2019-01-22 05:48:23 +00:00 by jonmchan · 0 comments
jonmchan commented 2019-01-22 05:48:23 +00:00 (Migrated from github.com)

It would be great as you suggested in #16 to provide an ability for a client to pass in a token to authenticate to localtunnel server to open the port for it. As it stands right now, anybody can be proxied using localtunnel. While this is great for a public service like localtunnel.me, it may be less desirable for internal/closed localtunnel servers.

Simple code on https://github.com/localtunnel/server/blob/master/server.js#L121 would probably do it:

const token = req.headers['x-access-token'];
if (token != opt.token) {
            res.statusCode = 403;
            res.end('Host header is required');
            return;
}

as well as updating the options passed and the client of course...

It would be great as you suggested in #16 to provide an ability for a client to pass in a token to authenticate to localtunnel server to open the port for it. As it stands right now, anybody can be proxied using localtunnel. While this is great for a public service like ```localtunnel.me```, it may be less desirable for internal/closed localtunnel servers. Simple code on https://github.com/localtunnel/server/blob/master/server.js#L121 would probably do it: ``` const token = req.headers['x-access-token']; if (token != opt.token) { res.statusCode = 403; res.end('Host header is required'); return; } ``` as well as updating the options passed and the client of course...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hoelee/server#108