Is there a simple way to test localhost endpoint with Apigee Edge?

Not applicable

Hi,

I am a nodejs developer but I am new to setting up a proxy. I did the test trial of a hello world with ApiGee and would like to know how I can test a node application I have running on localhost. Is there a simple set up to do this with ApiGee or do I need to have a registered DNS first online?

Thanks in advance!

Solved Solved
2 4 4,062
1 ACCEPTED SOLUTION

Apigee Edge (trial) runs in the cloud. In order too proxy an API call that is eventually handled by a machine on your desktop/laptop, your desktop/laptop needs to be accessible from the public internet.

You do not need a Dns name to resolve to your machine. DNS is just a name-resolution system. Put in a name like "api.ryanstorm.net" and get out an IP Address like 123.45.67.89 . The key thing is that a machine on the public internet can connect to the IP address for your machine, and the port. A machine on the internet doesn't need to know the DNS name of your IP address to send a message; it needs only to know the IP address. The DNS name is just a more convenient form; it's easier to remember.

If you work from a small office or home office, Home routers typically block all inbound traffic on port 80, but don't always block other inbound ports. In any case most home routers have an administrative panel in which you can open ports - and do ip+port mapping.

Not sure if this is helpful or not, but here goes: think of the router as the "front door" to your small office/home office (SOHO) network. The router typically has the only "publicly visible" IP address. Let's say that address is 123.45.67.89. (if you want to know your actual public IP address, you can google for it!) A machine out on the internet sends a message into that address, on port 80 (let's say) and the router, by default, blocks that traffic. Ignores it, no response. But you can modify your router's configuration so that when a TCP message arrives on 123.45.67.89:80, it forwards that inbound message to an IP address of a machine on your SOHO network. This is what I mean by "ip+port mapping". Then an app running on that machine - what you are calling localhost - can then receive to the message and act on it, and respond.

If a host on the internet can reach your localhost, then Apigee can reach your localhost. You just need to know your publicly-visible IP. The Target endpoint in Apigee will look like this:

<TargetEndpoint name='default'>
  <Description>default target endpoint</Description>
  <Flows/>
   ...
  <HTTPTargetConnection>
    <Properties/>
    <URL>http://123.45.67.89</URL> <!-- replace with your public IP -->
  </HTTPTargetConnection>
</TargetEndpoint>


But keep in mind that there are always security issues associated with opening ports and IP addresses. So do be careful and thoughtful about making changes.

View solution in original post

4 REPLIES 4

In conjunction to Edge, check out apistudio.io. As well as the many GitHub resources we have for getting your nodejs up and running on Edge.

@Christin Brown Thank you!

Apigee Edge (trial) runs in the cloud. In order too proxy an API call that is eventually handled by a machine on your desktop/laptop, your desktop/laptop needs to be accessible from the public internet.

You do not need a Dns name to resolve to your machine. DNS is just a name-resolution system. Put in a name like "api.ryanstorm.net" and get out an IP Address like 123.45.67.89 . The key thing is that a machine on the public internet can connect to the IP address for your machine, and the port. A machine on the internet doesn't need to know the DNS name of your IP address to send a message; it needs only to know the IP address. The DNS name is just a more convenient form; it's easier to remember.

If you work from a small office or home office, Home routers typically block all inbound traffic on port 80, but don't always block other inbound ports. In any case most home routers have an administrative panel in which you can open ports - and do ip+port mapping.

Not sure if this is helpful or not, but here goes: think of the router as the "front door" to your small office/home office (SOHO) network. The router typically has the only "publicly visible" IP address. Let's say that address is 123.45.67.89. (if you want to know your actual public IP address, you can google for it!) A machine out on the internet sends a message into that address, on port 80 (let's say) and the router, by default, blocks that traffic. Ignores it, no response. But you can modify your router's configuration so that when a TCP message arrives on 123.45.67.89:80, it forwards that inbound message to an IP address of a machine on your SOHO network. This is what I mean by "ip+port mapping". Then an app running on that machine - what you are calling localhost - can then receive to the message and act on it, and respond.

If a host on the internet can reach your localhost, then Apigee can reach your localhost. You just need to know your publicly-visible IP. The Target endpoint in Apigee will look like this:

<TargetEndpoint name='default'>
  <Description>default target endpoint</Description>
  <Flows/>
   ...
  <HTTPTargetConnection>
    <Properties/>
    <URL>http://123.45.67.89</URL> <!-- replace with your public IP -->
  </HTTPTargetConnection>
</TargetEndpoint>


But keep in mind that there are always security issues associated with opening ports and IP addresses. So do be careful and thoughtful about making changes.

@Dino Thanks for the reply! I will use that tip for when I am on my own network but I am at work so I will not be modifying the IP here:). That is very useful info for me nonetheless because I was not clear on modifying my router config.