Serverless to call target Url - Including port in url no works

team_mc
Member

I am trying to create an endpoint by "serverless function" of HubSpot. Unfortunately, when my script calls an the target url (outside HubSpot) includes port (except 80 and 443), it will fail to connect. For example

axios.post('http://domainoutsidehubsport:80/'),  return response.

axios.post('http://domainoutsidehubsport:12888/'),  no response.

(For testing, I created same api but in different port in the same domain)

 

Do anyone know why?

Thanks!

0 Upvotes
6 Replies 6
dennisedson
Community Manager

Hi @team_mc !

Welcome to the Community. 

Wanted to bring in a few others who have been working with serverless functions and see if they had any thoughts

@cornelius00 ., @jjimeno ,@dev-valentin , @darrengates have any of you had issues like this?

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
WendyGoh
HubSpot Employee

Hey @team_mc,

 

While I'm not aware of any restriction on our end to block non-standard ports (80 and 443), could you share with us the raw error message in question so that we can dig further into this? Thanks!

0 Upvotes
team_mc
Member

Hi @WendyGoh ,

 

If connect to non-standard ports(80 and 443), the error message: "A server error occurred: Memory: 71/128 MB\nRuntime: 20020.42 ms"

Do you know the reason? Thanks!

 

0 Upvotes
WendyGoh
HubSpot Employee

Hey @team_mc,

 

Thanks for sharing the error message! 

 

I believe this might be an issue with your team server implementation.

 

When I attempt to hit http://xx:12780/ directly on my local machine, the server on the other side hangs. 

 

The log statement you shared - Runtime: 20020.42 ms means that the serverless function timed out after 20s so it does not appear that the serverless function is not working. 

 

In this case, could your team check if you're able to access http://xx:12780/ ? 

0 Upvotes
team_mc
Member

Hi @WendyGoh ,

 

I do not suppose to exponse the server IP in the public area (community). 

Could you give me your contact to me?

 

Thanks!

 

0 Upvotes
WendyGoh
HubSpot Employee

Hey @team_mc,

 

Apologize on that. I've redacted the server IP on my post and on your initial post - (previously if I copy the link using the copy link address, I was able to get the server IP). 

 

Going forward, if it's more comfortable for you, feel free to reach me via DM. 

0 Upvotes