user2094257
user2094257

Reputation: 1715

Google Apps Script: Possible to send http requests to a local server that's not on interrnet?

I'm considering Apps script for a small project that involves fetching data from a local server that's not on the internet and then populating a Google sheets spread sheet with the data... I can't seem to find a clear answer to this question anywhere.

Is it possible to make HTTP requests from a Google spread sheet using Apps Script to a local server? I'm assuming as the Javascript is Client side code it should be possible?

Upvotes: 3

Views: 3658

Answers (1)

Spencer Easton
Spencer Easton

Reputation: 5782

It is possible as long as the local server is route able from a public address. Apps Script runs exclusively on Google's infrastructure so even when you click run in the IDE it is not your browser running the code, but a google server. There is a way to work around this as app script can serve webpages that can communicate with your script called webapps. The served webpages do run in your browser and can access the localhost.

https://developers.google.com/apps-script/guides/web
https://developers.google.com/apps-script/guides/html/

Upvotes: 5

Related Questions