tlyboy / proxy

🛠️ Proxy

Home Page:https://proxy.tlyboy.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

proxy

🛠️ Proxy

使用说明

axios

import axios from 'axios'

const res = await axios.post('https://proxy.tlyboy.dev/', {
  // https://github.com/unjs/ofetch
  request: 'https://www.bing.com/HPImageArchive.aspx',
  opts: {
    method: 'get',
    query: {
      format: 'js',
      idx: 0,
      n: 1,
      mkt: 'zh-CN',
    },
  },
})

console.log(res.data)

fetch

const response = await fetch('https://proxy.tlyboy.dev/', {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    // https://github.com/unjs/ofetch
    request: 'https://www.bing.com/HPImageArchive.aspx',
    opts: {
      method: 'get',
      query: {
        format: 'js',
        idx: 0,
        n: 1,
        mkt: 'zh-CN',
      },
    },
  }),
})

const json = await response.json()

console.log(json)

ofetch

import { ofetch } from 'ofetch'

const res = await ofetch('https://proxy.tlyboy.dev/', {
  method: 'post',
  body: {
    // https://github.com/unjs/ofetch
    request: 'https://www.bing.com/HPImageArchive.aspx',
    opts: {
      method: 'get',
      query: {
        format: 'js',
        idx: 0,
        n: 1,
        mkt: 'zh-CN',
      },
    },
  },
})

console.log(res)

docker

docker run -d --name proxy -p 3000:3000 tlyboy/proxy

compose.yml

services:
  proxy:
    image: tlyboy/proxy
    restart: unless-stopped
    # network_mode: host
    ports:
      - 3000:3000
    environment:
    # - PORT=3000

About

🛠️ Proxy

https://proxy.tlyboy.dev/

License:MIT License


Languages

Language:Dockerfile 51.0%Language:TypeScript 49.0%