code: def test_different_urls(self):
      replacer = URLReplacer(
          ports={4000: 5000, 3001: 5501, 3002: 5502},
          app_specs=[
              AppSpec(port=3001, app_name="qwerty"),
              AppSpec(port=3002, app_name="foobar"),
          ],
          hostname=localhost,
          secure=False,
      )
      assert (
          replacer(
              b"http://0.0.0.0:3001/qwerty and http://0.0.0.0:3002/foobar"
          )
          == b"http://127.0.0.1:5501/qwerty and http://127.0.0.1:5502/foobar"
      )
  
file_path: dstack/src/tests/_internal/core/services/test_logs.py
imports: from dstack._internal.core.models.runs import AppSpec
  from dstack._internal.core.services.logs import URLReplacer
label_desc: Use image node_id 6 for calling the TestTaskURLReplacer obj's underlying member method code with example usage: obj.test_different_urls() without return types