Snowflake-Labs / Excelerator

This is an Excel Addin for Windows that reads and writes data to Snowflake
Apache License 2.0
80 stars 22 forks source link

Manually set http proxy #26

Open jfjurw opened 3 years ago

jfjurw commented 3 years ago

Hi team ! It's working to specify a proxy in ODBC connection but do you have guideline to manually set proxy in Excelerator ?

ssegal100 commented 3 years ago

Hello. We don't have that built in yet. Are you looking for a field on the connection dialog to enter your host:port as the proxy server? I can add it but I'm not able to test it. If I showed you how to hard code this information into your connection, would you be able to make the change to th VBA code? It should be a simple change. If that works I can add the field to the connection dialog. Steve

jfjurw commented 3 years ago

Hi Steve

2 topics

Workaround I tested with env variable ("set http_proxy" and "set https_proxy") and it works.

Adapt VBA code

If I showed you how to hard code this information into your connection, would you be able to make the change to th VBA code? It should be a simple change.

Good idea, it's better to be able to set proxy in connection and not for whole excel (which is not the case in my workaround).

ssegal100 commented 3 years ago

OK, so in the Utils module image

Update the Function "ConnectionStringDSNLess()" by adding "proxy=:;" to the end of the ConnectionStringDSNLess variable. So it should look like this:

   ConnectionStringDSNLess = connectionType & "driver={SnowflakeDSIIDriver};server=" & LoginForm.tbServer & ";database=" & _
       CustomRange(sgRangeDefaultDatabase) & ";schema=" & CustomRange(sgRangeDefaultSchema) & ";warehouse=" & CustomRange(sgRangeWarehouse) & ";role=" & _
       sRole & ";Uid=" & LoginForm.tbUserID & ";proxy=<host>:<port>;"

Replace the host and port of course with yours. I can't test it so if it doesn't work you might have to play with it a bit. Let me know how it goes. Steve

jfjurw commented 3 years ago

Thanks,

Replace the host and port of course with yours. I can't test it so if it doesn't work you might have to play with it a bit. Let me know how it goes. Steve

It works (cut paste of your example)

ssegal100 commented 3 years ago

Great, thanks for letting me know. I'll work on adding it to the UI.

Skeewee commented 2 years ago

Hello @ssegal100 and Team!

Great tool you guys put together. :)

We're in a similar situation where we need to use the proxy. Saw your last comment about adding it to the UI and wondered if you would have some time for that, please? 🥇

Thanks!