title: How to access Twilio on restriced machine
body: <p>I'm writing an application to send SMS to my customers and I integrated with Twilio on localhost successfully. But my test environment is restricted machine and can't access to open network. Someone can define domain and when test machine tries to reach it, that address wilb resolved as address of Twilio.
  Such as she/he can define an address like this</p>
  <p><a href="https://external.domain.com:port" rel="nofollow noreferrer">https://external.domain.com:port</a></p>
  <p>But the question is how can I override host address of Twilio in application level?</p>
  <p>Here is sms sending code:</p>
  <pre><code>        String ACCOUNT_SID = &quot;&quot;;
          String AUTH_TOKEN = &quot;&quot;;
          Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
  
          try {
              toPhoneNumber = &quot;+&quot; + toPhoneNumber;
              Message message = Message
                      .creator(new PhoneNumber(toPhoneNumber), // to
                              new PhoneNumber(&quot;+90...&quot;), // from
                              smsTemplate)
                      .create();
  
              logger.info(&quot;message.getSid():&quot; + message.getSid());
              smsSent = true;
          } catch (Throwable t) {
              logger.error(&quot;Error on sending SMS to &quot; + toPhoneNumber);
              logger.error(&quot;Error is:&quot;);
              logger.error(ExceptionUtils.getFullStackTrace(t));
          }
  </code></pre>