accept a Buffer in addition to url