The goal is let the client hit the server at a specific time using their own browser, with potentially very long delay.
We will use [url removed, login to view] in this task. This api returns the current time.
As a client, if I set the target to 01:00:00 (1am), I want to be able to hit http://localhost:8000/utc/now at 00:45:00 (12:45am, 15 mins before target). When the page finish loading (at 1am), I should get the result 01:00:00. As if I visited [url removed, login to view] directly at 1am.
Your proxy should be completely transparent. Cookies should be forwarded, redirect should be forwarded, etc. One lib that does this is [url removed, login to view]
So user can simply use “localhost:8000” in place of “[url removed, login to view]”, everything will work as if the user is visiting [url removed, login to view] directly.
Pure node solution. No nginx, calling shell exec, etc.
The browser must not time out during the wait. It should be a generic solution that works with chrome and firefox.
For example, if I set firefox timeout to 5 seconds, the above scenario must work.
Your solution should be general enough that I can change [url removed, login to view] to other website.
The target is client specific, so every concurrent user will have a separate target, you should be able to deal with this.
How to communicate and store the target is up to you. It shouldn't need any external data storage (e.g. database, redis).
Deliverables: git repo (either hosted or zipped, can be public), that can be tested and started by 'npm install && npm test && npm start'. You should write test first and commit frequently with good commit messages.