# @types/koa-sslify

> TypeScript definitions for koa-sslify

Latest version **4.0.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/koa-sslify
pnpm add @types/koa-sslify
yarn add @types/koa-sslify
bun add @types/koa-sslify
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.6 |
| Published | 2023-11-07 |
| First published | 2017-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/koa-sslify
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-sslify
- npm.io page: https://npm.io/package/@types/koa-sslify

## Dependencies (1)

- [@types/koa](https://npm.io/package/@types/koa.md) *

## Recent versions

- 4.0.6 (latest) — 2023-11-07
- 4.0.3 (ts3.8) — 2021-12-24
- 4.0.2 (ts3.6) — 2021-07-08
- 4.0.1 (ts2.3) — 2019-05-14
- 4.0.5 — 2023-10-18
- 4.0.4 — 2023-09-14
- 4.0.0 — 2019-02-28
- 2.1.0 — 2017-12-11

## README

# Installation
> `npm install --save @types/koa-sslify`

# Summary
This package contains type definitions for koa-sslify (https://github.com/turboMaCk/koa-sslify#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-sslify.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-sslify/index.d.ts)
````ts
import koa = require("koa");

export interface Options {
    /**
     * Function used to test if request is secure
     */
    resolver?: ((ctx: koa.Context) => boolean) | undefined;
    /**
     * Hostname for redirect (uses request host if not set)
     */
    hostname?: string | undefined;
    /**
     * Port of HTTPS server
     */
    port?: number | undefined;
    /**
     * Avoid :443 port in redirect url
     */
    skipDefaultPort?: boolean | undefined;
    /**
     * Ignore url path (redirect to domain)
     */
    ignoreUrl?: boolean | undefined;
    /**
     * Temporary mode (use 307 Temporary Redirect)
     */
    temporary?: boolean | undefined;
    /**
     * Whitelist methods that should be redirected
     */
    redirectMethods?: string[] | undefined;
    /**
     * Status returned for disallowed methods
     */
    disallowStatus?: number | undefined;
}

/**
 * Default HTTPS resolver
 * This works when using node.js TLS support
 */
export function httpsResolver(ctx: koa.Context): boolean;

/**
 * x-forwarded-proto header resolver
 * common for heroku gcp (ingress) etc
 */
export function xForwardedProtoResolver(ctx: koa.Context): boolean;

/**
 * Azure resolver
 * Azure is using `x-att-ssl` header
 */
export function azureResolver(ctx: koa.Context): boolean;

/**
 * Custom proto header factory
 */
export function customProtoHeaderResolver(header: string): (ctx: koa.Context) => boolean;

/**
 * Resolver for `Forwarded` header
 * see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded
 */
export function forwardedResolver(ctx: koa.Context): boolean;

export default function factory(options?: Options): koa.Middleware;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:38 GMT
 * Dependencies: [@types/koa](https://npmjs.com/package/@types/koa)

# Credits
These definitions were written by [Matthew Bull](https://github.com/wingsbob), and [Mihkel Sokk](https://github.com/msokk).

---
_Source: https://npm.io/package/@types/koa-sslify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
